mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-04-27 14:57:40 +00:00
Merge pull request #11 from jtmarmon/patch-1
Add file syncing to README example
This commit is contained in:
commit
9e247e0909
1 changed files with 4 additions and 2 deletions
|
|
@ -37,8 +37,10 @@ If you prefer some other format I strongly encourage you to do pull request with
|
||||||
### Logging to file and STDOUT
|
### Logging to file and STDOUT
|
||||||
|
|
||||||
You can to file and STDOUT at the same time, you just need to assign new logger
|
You can to file and STDOUT at the same time, you just need to assign new logger
|
||||||
|
|
||||||
logger Logger.new GrapeLogging::MultiIO.new(STDOUT, File.open('path/to/your/logfile.log', 'a'))
|
log_file = File.open('path/to/your/logfile.log', 'a')
|
||||||
|
log_file.sync = true
|
||||||
|
logger Logger.new GrapeLogging::MultiIO.new(STDOUT, log_file)
|
||||||
|
|
||||||
### Logging exceptions
|
### Logging exceptions
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue