[ 
https://issues.apache.org/jira/browse/FLINK-33967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17895725#comment-17895725
 ] 

Kenneth William Krugler commented on FLINK-33967:
-------------------------------------------------

I think this should be reclassified as a minor bug. Including the 
log4j-test.properties file means anyone who wants to change logging when 
running tests has to use a somewhat-obscure workaround of adding a 
log4j2.component.properties to src/test/resources/ that contains 
log4j2.configurationFile=log4j2-test.properties, and then the desired 
log4j2-test.properties file in the same location.

It took me several hours, plus help from a Gradle expert, to figure out why 
this was causing logging to not work as expected in one of several 
sub-projects, but other sub-projects were fine. The problematic sub-projects 
were including the flink-runtime-1.19.1-tests.jar, which  also has this 
log4j2-test.properties file.

I think the solution, for Flink artifacts that have a test-jar goal, is to 
exclude this file via a <configuration><excludes> in the pom.xml

> Remove/Rename log4j2-test.properties in flink-streaming-java's test bundle
> --------------------------------------------------------------------------
>
>                 Key: FLINK-33967
>                 URL: https://issues.apache.org/jira/browse/FLINK-33967
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Koala Lam
>            Priority: Major
>
> This file from test classpath is picked automatically by Log4j2. In order to 
> reliably use our own log4j2 test config, we have to specify system property 
> "log4j2.configurationFile" which is not ideal as we have to manually set it 
> in IDE config.
> https://logging.apache.org/log4j/2.x/manual/configuration.html



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to