Header menu logo fable-electron-docs-api

netLog Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ✔

Logging network events for a session.Process: Mainconst { app, netLog } = require('electron')app.whenReady().then(async () => { await netLog.startLogging('/path/to/net-log') // After some network events const path = await netLog.stopLogging() 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.

Static members

Static member Description

netLog.currentlyLogging

Full Usage: netLog.currentlyLogging

Returns: bool

A boolean property that indicates whether network logs are currently being recorded.

Returns: bool

netLog.startLogging (path, ?captureMode, ?maxFileSize)

Full Usage: netLog.startLogging (path, ?captureMode, ?maxFileSize)

Parameters:
    path : string
    ?captureMode : CaptureMode
    ?maxFileSize : float

Returns: Promise<unit>
Modifiers: inline

resolves when the net log has begun recording.Starts recording network events to path.

path : string
?captureMode : CaptureMode
?maxFileSize : float
Returns: Promise<unit>

netLog.stopLogging ()

Full Usage: netLog.stopLogging ()

Returns: Promise<unit>
Modifiers: inline

resolves when the net log has been flushed to disk.Stops recording network events. If not called, net logging will automatically end when app quits.

Returns: Promise<unit>

Type something to start searching.