Skip to content
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

Add support for Log4j2 #18

Merged
merged 3 commits into from
May 3, 2016
Merged

Add support for Log4j2 #18

merged 3 commits into from
May 3, 2016

Conversation

mridang
Copy link

@mridang mridang commented May 3, 2016

No description provided.

@mridang mridang self-assigned this May 3, 2016
Logger.log4j.setLevel(org.apache.log4j.Level.toLevel(level));
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
LoggerConfig loggerConfig = ctx.getConfiguration().getLoggerConfig(Logger.juli.getName());
loggerConfig.setLevel(org.apache.logging.log4j.Level.OFF);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not set level instead of always using Level#OFF?

@oostman
Copy link

oostman commented May 3, 2016

Looks good, left one comment

PropertyConfigurator.configure(shutUp);
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
LoggerConfig loggerConfig = ctx.getConfiguration().getRootLogger();
loggerConfig.setLevel(org.apache.logging.log4j.Level.OFF);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this line do?
Sets the default and lets the configuration define the each particular level?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not logging configuration is defined. It turns it off entirely.

@leandroutn
Copy link

looks good to me too (haven't tested it though)

@mridang mridang merged commit 63594d7 into 1.4.x May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants