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
Supporting Custom Logger Class #2511
Comments
Does e.g. log_formatter do |str|
"[#{Process.pid}] [#{Socket.gethostname}] #{Time.now}: #{str}"
end |
No. Using I suggest that we support the use of a custom logger for outputting of log lines Lines 62 to 69 in 503b1cd
ErrorLogger
|
How about Lines 388 to 399 in 503b1cd
|
So, do you expect to use it like something like this? # config/puma.rb
...
custom_logger_class CustomLogger
...
# custom_logger.rb
class CustomLogger
def call(level, message)
...
end
end |
Generally with a custom logger I would expect a config interface like: logger Logger.new(STDOUT) |
For reference, the interface is a little different from what @nateberkopec has suggested:
|
Is your feature request related to a problem? Please describe.
It is possible to have custom loggers that allow for json log aggregation as well as formatting and custom attributes.
Without json log aggregation results in poorly formatted logs and duplication of log formatting rules.
Describe the solution you'd like
It would be great to pass a custom logging class to puma that would then be logged to.
I would expect this to result in a new method in the DSL.
The text was updated successfully, but these errors were encountered: