Skip to content

Add missing test log4j2.xml files#963

Merged
madrob merged 1 commit intoapache:mainfrom
madrob:log4j2-xml
Aug 4, 2022
Merged

Add missing test log4j2.xml files#963
madrob merged 1 commit intoapache:mainfrom
madrob:log4j2-xml

Conversation

@madrob
Copy link
Contributor

@madrob madrob commented Aug 4, 2022

When running tests in most of the modules, we don't get any log output because there was no logging configuration. I wonder if we could have some kind of gradle rule to validate that we have a log4j2.xml in every test-files folder?

@madrob madrob requested a review from uschindler August 4, 2022 19:14
@madrob madrob merged commit 8f74121 into apache:main Aug 4, 2022
@uschindler
Copy link
Contributor

uschindler commented Aug 4, 2022

Why not simply put the logi4j XML file into the Test-Framework.jar file? Log4j can load its config from classpath.
Sorry for late response, came back a minute ago.

madrob added a commit that referenced this pull request Aug 4, 2022
@madrob
Copy link
Contributor Author

madrob commented Aug 4, 2022

@uschindler just tried that and yep, it seems to work just as well. Need to check if how it handles conflicts when we have xml config in test-framework and a specific module, which one wins? If that works as expected I'll revert this and do that instead.

@uschindler
Copy link
Contributor

uschindler commented Aug 4, 2022

It depends on order of classpath. Not fully sure how Gradle sets it up, but if test framework comes first in classpath it loads from there.
When we change to java modules like in Lucene, this would be one part to be revisited and correct module opens added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants