Electron Documentation


Logging network events for a session.

Process: Main

const { netLog } = require('electron')

app.on('ready', function () {
  // After some network events
  netLog.stopLogging(path => {
    console.log('Net-logs written to', path)

See --log-net-log to log network events throughout the app's lifecycle.

Note: All methods unless specified can only be used after the ready event of the app module gets emitted.


  • path String - File path to record network logs.

Starts recording network events to path.


  • callback Function (optional)

    • path String - File path to which network logs were recorded.

Stops recording network events. If not called, net logging will automatically end when app quits.


A Boolean property that indicates whether network logs are recorded.


A String property that returns the path to the current log file.

Keyboard Shortcuts

Key Action
/ Focus the search bar
Esc Focus the search bar and cleans it
Select the next search result
Select the previous search result
Enter Open the selected search result
cmdEnter Ctrl+Enter Open the selected search result in a new tab