-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continue writing to log file? #52
Comments
Hi, It's not possible to do this from a single Ruby I'm not saying it's impossible, but it's not something that LogStashLogger supports out of the box. |
i work next door to UCLA! :) anyway, can the railtie.rb be tweaked to accomplish this? I see |
That's cool! I graduated from UCLA in 2006 in physics. Now I live in Pasadena and work as a software engineer. Back to the topic - The Ruby An alternative design we could explore would be to instead have multiple loggers, each with a configurable formatter. |
Alternatively you can use https://github.com/ffmike/multilogger as a shim in front of multiple logger instances - one from LogStashLogger and one from ActiveSupport. |
@ffmike Thanks for the tip! I was planning to offer similar functionality in an upcoming release. Now that I've seen MultiLogger, I might just pull it in as a dependency instead of rolling my own. |
@ffmike I was planning to pull in your code, but it doesn't appear to be released as a gem on rubygems.org. Mind if I vendor in your code and credit you? |
The new :multi_logger type writes log messages to multiple loggers. Each logger can have its own formatter. Fixes #52
Sure, help yourself. I banged that together quickly for use in one of our internal projects and haven't bothered to gemify it. |
@ffmike Thanks! I credited you in the readme. Support for this released in 0.13.0. Example configuration: config.logstash.type = :multi_logger
config.logstash.outputs = [
{ type: :file, path: 'log/development.log', formatter: ::Logger::Formatter },
{ type: :file, path: '/var/log/development.log' }
] |
Is it possible to continue writing to the regular environment.log file, in the default non-json rails log format?
we use logstash logger like this
config.logstash = [ { type: :file, path: 'log/development.log' }, { type: :file, path: '/var/log/development.log' } ]
The text was updated successfully, but these errors were encountered: