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

Unable to set logfile name/path for QuarkusTests #10202

Closed
famod opened this issue Jun 23, 2020 · 8 comments · Fixed by #10205
Closed

Unable to set logfile name/path for QuarkusTests #10202

famod opened this issue Jun 23, 2020 · 8 comments · Fixed by #10205
Labels
kind/bug Something isn't working
Milestone

Comments

@famod
Copy link
Member

famod commented Jun 23, 2020

Describe the bug
When executing tests (via maven surefire), quarkus.log.file.enable=true (via -D or application.properties/.yaml) enables logging to target/quarkus.log (default). So far so good.
But setting quarkus.log.file.path=quarkus-test.log has no effect, Quarkus always seems to log to quarkus.log for tests.

Expected behavior
quarkus.log.file.path shoul be picked up just as it is being picked up in dev-mode etc.

Actual behavior
When file logging is activated, test always log to quarkus.log, not the configured file.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/quarkusio/quarkus-quickstarts
  2. cd getting-started
  3. mvn clean test -Dquarkus.log.file.enable=true -Dquarkus.log.file.path=quarkus-test.log (or create a corresponding application.properties)

Configuration

quarkus.log.file.enable=true
quarkus.log.file.path=quarkus-test.log

Screenshots
n/a

Environment (please complete the following information):

  • Output of uname -a or ver:
    MINGW64_NT-10.0-18363 XXX 3.0.7-338.x86_64 2019-11-21 23:07 UTC x86_64 Msys
  • Output of java -version:
    openjdk version "11.0.7" 2020-04-14
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
    
  • GraalVM version (if different from Java): n/a
  • Quarkus version or git rev: 1.4.2.Final or 1.5.2.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3

Additional context
quarkus.log.file.rotation.file-suffix: .yyyy-MM-dd seems to work as expected.

@famod famod added the kind/bug Something isn't working label Jun 23, 2020
@famod
Copy link
Member Author

famod commented Jun 23, 2020

cc @tkalmar & @harthorst

@geoand
Copy link
Contributor

geoand commented Jun 23, 2020

But why?

An oversight most likely. #10205 should fix the issue (for system properties, for application.properties it doesn't have an effect)

@famod
Copy link
Member Author

famod commented Jun 23, 2020

Oh wow, very quick PR. Thanks!

Do see any chance to make it work for app properties as well?

@geoand
Copy link
Contributor

geoand commented Jun 23, 2020

Yeah, we probably could make it work, but it's more work that I am not sure is worth the trouble 😁

geoand added a commit that referenced this issue Jun 24, 2020
Ensure that a set quarkus.log.file.path system prop is used in tests
@famod
Copy link
Member Author

famod commented Jun 24, 2020

Thanks for (partially) fixing it!

Yeah, we probably could make it work, but it's more work that I am not sure is worth the trouble

The thing is that I lost time trying to figure out what is going on and this might also happen to others.
I'll create another ticket then so that other users can find the problem more quickly.

@famod
Copy link
Member Author

famod commented Jul 8, 2020

Just wanted to confirm that the system property is now working as expected. We are creating a quarkus-test-X.log per Maven Surefire test fork:

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <systemPropertyVariables>
            <quarkus.log.file.path>quarkus-test-${surefire.forkNumber}.log</quarkus.log.file.path>
        </systemPropertyVariables>
    </configuration>
</plugin>

@geoand
Copy link
Contributor

geoand commented Jul 8, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants