Better Log Formatter
A formatter allowing you to add dynamic tags to your logs with sidekiq tags support
Usage
logger = Logger.new(STDOUT)
formatter = BetterLogFormatter.new("my_app")
formatter.custom_tag(:foo) { 'Bar' }
formatter.custom_tag(:request_id) { Request.id }
logger.formatter = formatter
logger.info "Hello world!"
Also, timestamp can be hidden or removed:
formatter.datetime_format = "%m/%d/%y - %H:%M:%S "
logger.info "Hello world!"
formatter.datetime_display = false
logger.info "Hello world!"
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/spuyet/better_log_formatter.
License
The gem is available as open source under the terms of the MIT License.