Java logs installation
Logs is in alpha
Logs is currently in beta. To gain access, opt-in to the beta from your feature previews menu. Logs is free to use during beta, though we'd love to hear your feedback in app.
- 1
Install OpenTelemetry packages
RequiredAdd the following dependencies to your
pom.xml:XML - 2
Get your project token
RequiredYou'll need your PostHog project token to authenticate log requests. This is the same token you use for capturing events and exceptions.
You can find your project token in Project Settings.
- 3
Configure the SDK
RequiredSet up the OpenTelemetry SDK to send logs to PostHog.
JavaAlternatively, you can pass the token as a query parameter:
Java - 4
Use OpenTelemetry logging
RequiredNow you can start logging with OpenTelemetry:
Java - 5
Next steps
CheckpointWhat you can do with your logs