Nicster15
Nicster15

Reputation: 169

Electron - Where does logging go?

I've created an electron application and bundled it using electron-builder. It all works great, though as this application is still in it's alpha stages there's a lot of debug that gets printed via console.log (in the backend of the application, not the frontend/renderer).

So my question is, as no terminal/command prompt gets opened with the application, where does all this logging go, and can I retrieve it to review where my application went wrong?

Thank you!

Upvotes: 4

Views: 6399

Answers (1)

Rhayene
Rhayene

Reputation: 935

There are two places where console.log output goes:

If you log in the renderer process, you can see it in the console in the browser window. If you open the dev tools programmatically you can see this console even after building.

If you log in the main process, you can see these messages if you start the intalled app or the unpacked binary via command line. In windows this would be the app.exe in the win-unpacked directory that electron-builder creates.

Another alternative would be a logger like electron-log that writes the log messages into a configured file.

Upvotes: 5

Related Questions