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
posthog.init('<ph_project_api_key>', {api_host: https://us.i.posthog.com,enable_recording_console_log: true,// ... other options})