Understanding Electron Logging


I have an app and by redirecting stdout/err on the command line I can capture logging in a file, e.g.

[23672:0429/130707:INFO:renderer_main.cc(211)] Renderer process started
[23664:0429/130708:ERROR:backend_impl.cc(1996)] Invalid cache (current) size

But I’d like to send the log data to another app for aggregation/monitoring. I’d also like to be able to adjust the log levels, modify format, etc. I tried to redirect logging to a stream however it never gets called:

process.defineGetter(‘stdout’, function() {
return stream;

I’d appreciate any hints on how I might be able to redirect log output or if there is a higher level mechanism for managing logging in Electron.


You might want to try the nodejs debug module.