Java logs installation
Logs is in beta
Logs is free to use whilst in 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 API key
RequiredYou'll need your PostHog project API key to authenticate log requests. This is the same API key you use for capturing events and exceptions.
You can find your project API key in Project Settings.
- 3
Configure the SDK
RequiredSet up the OpenTelemetry SDK to send logs to PostHog.
JavaAlternatively, you can pass the API key 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