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.

Important: Individual console logs are truncated at 2000 characters. The rest of the log is not sent to PostHog. When truncating a log message we add ...[Truncated] to the message

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

Questions?

Was this page useful?

Next article

Console logs recording

PostHog can capture canvas elements from your application. It works in both 2D and WebGL environments. As canvas elements can contain sensitive information, we do not capture these automatically. You can enable this feature globally from your replay settings . Canvas elements are recorded at a rate of 4 frames per second which may lead to some perceptual differences during playback. Important: There is no way to mask canvas elements right now so please ensure that they are are free of PII…

Read next article