Understanding Electron Logging


#1

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
[23664:0429/130708:INFO:CONSOLE(1037)]

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.


#2

You might want to try the nodejs debug module.