eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.12k stars 2.5k forks source link

Have a way (maybe default) to save the logs to specific files #1687

Open epatpol opened 6 years ago

epatpol commented 6 years ago

VS code saves (under linux) the different log files exthost.log, main.log, renderer.log, sharedprocess.log under ~/.config/Code/logs/YYYYMMDDT?????. I still haven't figured out the exact format they use, but I think it would be nice if we did something similar. It could be a CLI argument to enable it and specify a path. It's not really useful when developping Theia as you can usually just scroll back a few lines to see what the logs were, but in the case of a backend that could have been running for weeks it makes sense to be able to easily fetch that.

Note that this wouldn't be a big change, as bunyan supports having multiple streams (so we could still keep the standard output logs).

akosyakov commented 6 years ago

Could we consider to have flexible bunyan configuration file. So it will allow to specify default logger settings, like level and which stream should be used, as well override them for child loggers.

Updated The issue for the conf file in bunyan: https://github.com/trentm/node-bunyan/issues/585 https://github.com/trentm/node-bunyan/issues/153 suggesting to use JSON as a conf file

We could use JS file exporting bunyan logger options as a conf file. It will allow any kind of configurations supported by bunyan. Something like here but supporting child loggers as well.

epatpol commented 6 years ago

Nice, if it was directly supported in bunyan that would indeed save us some trouble of having to manage that configuration file ourself. The JS file exporting the options isn't a bad idea either.