Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crohr/syslogger
Dead simple Ruby Syslog logger
https://github.com/crohr/syslogger
Last synced: 4 days ago
JSON representation
Dead simple Ruby Syslog logger
- Host: GitHub
- URL: https://github.com/crohr/syslogger
- Owner: crohr
- License: mit
- Created: 2010-03-05T08:29:29.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T04:19:10.000Z (6 months ago)
- Last Synced: 2025-01-31T17:26:33.168Z (11 days ago)
- Language: Ruby
- Homepage: http://github.com/crohr/syslogger
- Size: 132 KB
- Stars: 114
- Watchers: 6
- Forks: 42
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ruby - Syslogger - A drop-in replacement for the standard Logger Ruby library, that logs to the syslog instead of a log file. (Logging)
README
## Syslogger
[![GitHub license](https://img.shields.io/github/license/crohr/syslogger.svg)](https://github.com/crohr/syslogger/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/crohr/syslogger.svg)](https://github.com/crohr/syslogger/releases/latest)
[![Gem](https://img.shields.io/gem/v/syslogger.svg)](https://rubygems.org/gems/syslogger)
[![Gem](https://img.shields.io/gem/dtv/syslogger.svg)](https://rubygems.org/gems/syslogger)
[![CI](https://github.com/crohr/syslogger/workflows/CI/badge.svg)](https://github.com/crohr/syslogger/actions)A drop-in replacement for the standard Logger Ruby library, that logs to the syslog instead of a log file.
Contrary to the SyslogLogger library, you can specify the facility and the syslog options.## Installation
```sh
$ gem install syslogger
```## Usage
```ruby
require 'syslogger'# Will send all messages to the local0 facility, adding the process id in the message
logger = Syslogger.new("app_name", Syslog::LOG_PID, Syslog::LOG_LOCAL0)# Optionally split messages to the specified number of bytes
logger.max_octets = 480# Send messages that are at least of the Logger::INFO level
logger.level = Logger::INFO # use Logger levelslogger.debug "will not appear"
logger.info "will appear"
logger.warn "will appear"
```## Contributions
See .
## Copyright
Copyright (c) 2010 Cyril Rohr, INRIA Rennes-Bretagne Atlantique. See LICENSE for details.