Module: Yarder::TaggedLogging
- Defined in:
- lib/yarder/tagged_logging.rb
Overview
Wraps any standard Logger object to provide tagging capabilities.
logger = Yarder::TaggedLogging.new(Logger.new(STDOUT)) logger.tagged(‘BCX’) { logger.info ‘Stuff’ } # Adds BCX to the @tags array and “Stuff” to the @message logger.tagged(‘BCX’, “Jason”) { logger.info ‘Stuff’ } # Adds ‘BCX’ and ‘Jason’ to the @tags array and “Stuff” to the @message logger.tagged(‘BCX’) { logger.tagged(‘Jason’) { logger.info ‘Stuff’ } } # Adds ‘BCX’ and ‘Jason’ to the @tags array and “Stuff” to the @message
This is used by the default Rails.logger when the Yarder gem is added to a rails application to make it easy to stamp JSON logs with subdomains, request ids, and anything else to aid debugging of multi-user production applications.
Defined Under Namespace
Modules: Formatter