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 and their performance that occur during the browser session, so you can see the effect of slow network requests or errors on the user experience. You can enable network recording from your project settings : To remove sensitive information from the URL, these network requests can be modified before being captured like so:

Read next article