Skip to content

Java: Document how to disable spy.log file. #4754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/platforms/java/common/performance/instrumentation/jdbc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ libraryDependencies += "io.sentry" % "sentry-jdbc" % "{{ packages.version('sentr

For other dependency managers, check out the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-jdbc).

### Configure

Configure the `DataSource` to use `com.p6spy.engine.spy.P6SpyDriver` as a JDBC driver. For Spring Boot applications:

```properies {tabTitle: application.properties}
Expand All @@ -57,3 +59,11 @@ spring.datasource.url: jdbc:p6spy:postgresql://localhost:5432/db
```

P6Spy uses a Java [Service Loader](https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html) mechanism to register `JdbcEventListener`s. For more configuration options, check the [P6Spy Reference Guide](https://p6spy.readthedocs.io/en/latest/).

### Disable Log File Generation

In addition to spans, P6Spy logs JDBC statements to a log file by default. Because this file can grow rapidly, we recommend disabling creating a log file by setting a system property `p6spy.config.modulelist` to `com.p6spy.engine.spy.P6SpyFactory` or creating a `spy.properties` file in `src/main/resources` with the content:

```properties
modulelist=com.p6spy.engine.spy.P6SpyFactory
```