How to output
##How to output
Logger.new("Output destination", 'Output contents')
ex) Logger.new('/log/development', "Output contents")
##There seems to be such a way of writing
logger = Logger.new('/log/development')
logger.debug 'What you want to output'
When it is logged by the method to output, label? Is different.
By changing this label, I feel like changing the settings of the detection tool (I'm not sure about the infrastructure environment).
## logger.debug 'What you want to output'in the case of
D, [2020-10-04T08:41:46.184230 #6] DEBUG -- :Will it be output?
##logger.info 'What you want to output'
I, [2020-10-04T08:43:51.453817 #6] INFO -- :Will it be output?
Under log directory
If the location of the first argument of Logger does not exist, it will be newly created.
Logger.new('/log/hello.log', "hello")
Recommended Posts