Skip to content

sentry-log4j2 should be added to log4j-core, not log4j-api #1152

@Vampire

Description

@Vampire

Gradle Version

9.4.1

AGP Version

n/a

Code Minifier/Optimizer

None

Version

6.4.0

Sentry SDK Version

8.39.0

Steps to Reproduce

Have a project with log4j-api, apply the sentry plugin

Expected Result

sentry-log4j2 is added to log4j-core

log4j-api does note necessarily mean that log4j is used as logging backend.
log4j-api is like slf4j just a logging facade and you could use various bindings to process those logging calls.

Also, adding it to log4j-api means it ends up in your compile classpath which makes compilation slower and reduces up-to-date-rate and cache-hit-rate.

The sentry appender can only be used if you actually use log4j-core in your runtime classpath, so the sentry dependency should be added to log4j-core, not to log4j-api.

Actual Result

sentry-log4j2 is added to log4j-api

Metadata

Metadata

Assignees

Labels

AndroidBugSomething isn't working
No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions