Skip to content

rspine/logging

Repository files navigation

Spine::Logging

Gem Version Dependency Status Code Climate security Inline docs

Formatters for logger.

Installation

To install it, add the gem to your Gemfile:

gem 'spine-logging'

Then run bundle. If you're not using Bundler, just gem install spine-logging.

Usage

Logging to file:

logger = Spine::Logging.file('development')
logger.info('Hey')
# [INFO 2015-05-27T10:35:27.377Z #9883] Hey

Logging to standard output:

logger = Spine::Logging.output
logger.info('Hey')
# [INFO 2015-05-27T10:35:27.377Z #9883] Hey

Logging to syslog:

Spine::Logging.extend(Spine::Logging::Logs::Syslog)
logger = Spine::Logging.syslog('my_app')
logger.info('Hey')
# Hey