roidrage / lograge

An attempt to tame Rails' default policy to log everything.
http://www.paperplanes.de/2012/3/14/on-notifications-logsubscribers-and-bringing-sanity-to-rails-logging.html
MIT License
3.44k stars 295 forks source link

Using Lograge with other logger #280

Open LYHuang opened 5 years ago

LYHuang commented 5 years ago

Hello,

I am currently try to use lograge and logdna-rails in my application, logdna-rails can send the log to the cloud platform.

At first I am using the setting like this:

config.lograge.enabled = true
config.lograge.logger = Logdna::RailsLogger.new('apiKey', options)

However I notice that lograge will change the behavior of default logger and not calling the log function in logdna-rails.

I also try this setting:

config.lograge.enabled = true
config.lograge.keep_original_rails_log = true
config.logger = Logdna::RailsLogger.new('apiKey', options)

This one is sending the log, but it doesn't format by the lograge, is there any way to set up the custom logger for the lograge? Thank you.

braxtonj commented 2 years ago

Hey @LYHuang!

Sadly a bit late but check out our blog post on this and the example repo detailing Lograge implementation with LogDNA if you are still having trouble 👌