Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

APEXCORE-169 - instantiating DTLoggerFactory during test causes incorrect logging behavior#375

Merged
asfgit merged 2 commits intoapache:masterfrom
vrozov:APEXCORE-169
Aug 27, 2016
Merged

APEXCORE-169 - instantiating DTLoggerFactory during test causes incorrect logging behavior#375
asfgit merged 2 commits intoapache:masterfrom
vrozov:APEXCORE-169

Conversation

@vrozov
Copy link
Member

@vrozov vrozov commented Aug 25, 2016

@tweise, @ChandniSingh Please review

org.apache.log4j.Logger streamingAppMasterLogger = LogManager.getLogger(StreamingAppMaster.class);
Assert.assertNull(streamingAppMasterLogger.getLevel());
Map<String, String> changes = Maps.newHashMap();
changes.put("_.org.apache.*", "WARN");
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the logger names expected to be prefixed with _. now or is this just to isolate the test? Does anything change for the user (config, web service)?

Copy link
Member Author

Choose a reason for hiding this comment

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

"_." is to avoid impacting log level during unit tests. There is no change in how log levels are set during run-time.

@tweise
Copy link
Contributor

tweise commented Aug 27, 2016

Did you test dynamic log level change on the running app?

@vrozov
Copy link
Member Author

vrozov commented Aug 27, 2016

Yes, I tested setting log level for a running application. It works as before, except that log levels of newly created loggers that don't match pattern will be set based on nearest matching log level of ancestor specification, instead of the root logger.

@asfgit asfgit merged commit 9c48c41 into apache:master Aug 27, 2016
@vrozov vrozov deleted the APEXCORE-169 branch September 8, 2016 23:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments