Console logs recording

Last updated:

|Edit this page

PostHog can capture console logs from your application. This is useful for debugging and providing extra context on what is happening in your user's browser environment.

As console logs can contain sensitive information, we do not capture these logs automatically. You can enable this feature globally from your project settings or client-side by setting enable_recording_console_log: true in our JavaScript web library config.

Important: Console logs are recorded if either the project setting or the client-side config is set to true. Console logs are not recorded if session replay is not enabled.

Web
posthog.init('<ph_project_api_key>', {
api_host: '<ph_instance_address>',
enable_recording_console_log: true,
// ... other options
})

Questions?

Was this page useful?

Next article

Network performance recording

PostHog can capture network requests that occur during the browser session, so you can see if your application is sending the expected requests and response, and check the effect of slow network requests or errors on the user experience. You can enable network recording from your project settings : When enabled PostHog always captures: the network request URL, performance information about the request, When request capture is enabled you can also enabled payload and body capture, this…

Read next article