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

NO-JIRA proposed log4j commented out log configuration for testing #4816

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

clebertsuconic
Copy link
Contributor

I have to keep looking how to do this every time I need it. I just wanted to proposed a commented out section for next time I need this again.

I have to keep looking how to do this every time I need it.
I just wanted to proposed a commented out section for next time I need this again.
@clebertsuconic
Copy link
Contributor Author

I don't know if there's a better way to do this though

@jbertram jbertram merged commit 460faf5 into apache:main Feb 7, 2024
6 checks passed
@gemmellr
Copy link
Member

gemmellr commented Feb 8, 2024

I can think of a couple nicer routes that would likely also be quicker/easier to actually use.

First, the build is already set up such that the maven.test.redirectTestOutputToFile standard config property controls whether the test output is written to file or not. Just run e.g. mvn test -Dmaven.test.redirectTestOutputToFile and the test output is then written to files in target/surefire-reports/

This is what I use when I want a file, or more often just to not see the rather spammy test output as I am more interested in the results at the time. To make it easier to use if not remembering the property, when I removed the hard coded config that prevented using the standard prop I also set it up so that the property is actually unnecessarily defined in the pom already, giving a quick way to figure it out from the pom without going to read the actual plugin docs.

Alternatively, the log4 test config file used is itself set by a property in the pom. That can presumably be updated, so rather than comment the config in/out in the regular file, a second file could be added that had the desired config and could just be specified when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants