-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Upgrading 2.21.1 to 2.22.0 causes compilation failure on BaselineIgnore
#2232
Comments
@big-andy-coates, I guess this is similar to the issue reported in #2144. AFAIU, you are using
in combination with |
@big-andy-coates, a side note: Are you sure you need |
In this instance I'm interacting with Log4j to programmatically disable all logging (which I don't think is possible with only Slf4J). I'm guessing I could/should switch the compiletime dependency to Actually, tried that and got compilation error and I'm using private static void disableLog4J() {
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final org.apache.logging.log4j.core.config.Configuration config = ctx.getConfiguration();
config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME).setLevel(Level.OFF);
ctx.updateLoggers(config);
} |
Adding |
Logging APIs don't provide methods to configure the logging backend (and probably should not provide one). For a basic usage, you should use the try {
Configurator.setRootLevel(Level.OFF);
} catch (final NoClassDefFoundError | ClassCastException e) {
// either `log4j-core` is not on the classpath or `log4j-api` is bound to another implementation (e.g. `log4j-to-slf4j`).
} Many integrator libraries (like Spring Boot) provide an abstraction to deal with programmatic configuration of an à-priori unknown logging backend. In Spring Boot you'd write: final ClassLoader cl = ...
LoggingSystem.get(cl).setLogLevel(LoggingSystem.ROOT_LOGGER_NAME, LogLevel.OFF); |
Description
When updating log4j from v2.2.21.1 to v2.22., I see the build fail the following error:
This looks to be related to this PR and specifically this commit, which adds the
@BaselineIgnore
annotation to theLevel
class.For whatever reason, my build doesn't seem to be pulling in the annotation as a dependency and it doesn't like it. I'm not doing anything funky, just adding a Gradle dependency:
Any ideas?
Configuration
Version: moving from 2.21.1 to 2.22.0
Operating system: MacOS locally and Linux GitHub Runner
JDK: adopt JDK 17
Logs
Reproduction
PR reproducing the issue: creek-service/json-schema-validation-comparison#123
The text was updated successfully, but these errors were encountered: