Created
June 1, 2016 12:10
-
-
Save katpadi/87edc24445d64ef25bf956c79717f1ee to your computer and use it in GitHub Desktop.
basic logger
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
class StellarLogger < Logger | |
def format_message(severity, timestamp, progname, msg) | |
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" | |
end | |
end | |
logfile = File.open("#{Rails.root}/log/stellar.log", 'a') # create log file | |
logfile.sync = true # automatically flushes data to file | |
STELLAR_LOGGER = StellarLogger.new(logfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment