Replies: 2 comments 4 replies
-
Yes you can completely change the log output format. The documentation is brief but see |
Beta Was this translation helpful? Give feedback.
-
@ioquatix, hey there! Hope you're well! I try to implement this like this: .env: CONSOLE_OUTPUT="HappyLogger" lib/console/output/happy_logger.rb: module Console
module Output
class HappyLogger
def self.new(output, **options)
Rails.logger.info(output, context: options) # I have custom Rails.logger, so actually I need to wrap other events as well (i.e. errors, etc.)
end
end
end
end and ... it worked, but not as I've expected. The reason is that the link with example has another code with What's more if I set the CONSOLE_OUTPUT="JSON", it doesn't log in json format. |
Beta Was this translation helpful? Give feedback.
-
F.e., I have now this log -
{"time":"2024-10-24T13:19:48+00:00","severity":"info","oid":25200,"pid":1,"subject":"Falcon::Service::Application","message":"Binding to #<Async::HTTP::Endpoint http://0.0.0.0:3000/ {}>..."}
but my custom logger uses another fields...Beta Was this translation helpful? Give feedback.
All reactions