Created
July 9, 2020 13:16
-
-
Save tasdikrahman/47655821e2938315c3afe63fb096990b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/logger/log_formatter.rb | |
class LogFormatter < ::Logger::Formatter | |
def call(severity, time, program_name, message) | |
message = '' if message.blank? | |
severity = '' if message.blank? | |
{ | |
level: severity, | |
progname: program_name, | |
message: message, | |
}.to_json + "\r\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment