Closed melihcoban closed 7 months ago
I set log.transports.file.level = "info" in another file long before, that was why debug message were not written to the file. My bad, sorry!
Hello, could you please tell me how to fix this error (Attempted to register a second handler for '__ELECTRON_LOG__')?
This is my electron webPreferences:
I initialize the electron-log in main process.
Logging works just fine in the main process. However, when I try to log from renderer process (React), I can see the log in the console, but it is not written to a file.
Console:
11:18:33.054 > Testing
Example Code:
I tried to log from preload.ts as well. I created a context bridge for logging.
However, this does not log to file as well. In the preload file do I need to import the electron-log/main or electron-log/renderer? What could be the issue here?
EDIT: Importing 'electron-log/main' from both main and preload file gives error
Attempted to register a second handler for '__ELECTRON_LOG__'
while application is packaged. Importing renderer in preload does not log messages.