Open tomdixon opened 3 weeks ago
Your code looks fine. Can you try to call logging with a delay in a renderer process? E.g. setTimeout(() => log.info('Hello world'), 1000)
Thanks for the quick reply. Unfortunately that still doesn't lead to the log file being written. I'm just trying it now in a vanilla Electron project. If that also doesn't work I'll link to the code here.
OK I figured it out. Two things happening at once!
main.log
. Is this intentional? Is there anyway to configure the file logger to use a different file path for renderer logs?'electron-log/renderer'
. It seems that if this import exists in the main process at all (even if the log
function is never called) then renderer logs stop logging to file. Is there a recommended setup here, as I can imagine this being an easy trap to fall into especially if you use shared utilities between main and renderer code?resolvePath
callback. The second argument is a message object containing information about the process where the log was generated.Your code looks fine. Can you try to call logging with a delay in a renderer process? E.g.
setTimeout(() => log.info('Hello world'), 1000)
Hello, I encountered a similar problem. The logs printed in the main process are not printed in the console of the renderer process. Is it because I am not using bundler, I cannot import "electron-log/renderer" in HTML, or is it another configuration problem?
@TuKun33 When contextIsolation/sandboxing is enabled (by default), and no bundling is used, it's only possible to use a limited set of logger features in a renderer process.
Hi,
After updating to
v5.2.0
fromv4.2.2
I'm no longer seeing renderer process logs written to therenderer.log
file as before. I've set up the main/remote logging as per the README, and I am getting console logs which indicates that the logs are being sent to the main process via IPC ok. Any ideas what I might be doing wrong?My setup is as follows:
Main process
Renderer process