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

Logs sent to two files with default configuration #25424

Open
oliviercailloux opened this issue May 6, 2022 · 3 comments
Open

Logs sent to two files with default configuration #25424

oliviercailloux opened this issue May 6, 2022 · 3 comments
Labels
area/logging kind/bug Something isn't working

Comments

@oliviercailloux
Copy link

Describe the bug

With quarkus.log.file.enable (in supplement to the default console log), running mvn test creates two quarkus.log files instead of one as expected. One is in the project root (in the folder containing pom.xml) and contains a single line: INFO [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final. The other one is in the target subfolder and contains (almost) all the rest of the log, i.e., for example, DEBUG [org.hib.SQL] (JPA Startup Thread: <default>)

One line is missing entirely from the file logs, but appears in the console logs: INFO [org.jbo.res.plu.val.i18n] (main) RESTEASY008550: Unable to find CDI supporting ValidatorFactory. Using default ValidatorFactory.

I suspect a timing problem, probably a thread starts writing in a log file before another thread takes over and writes in another log file. My computer is quite old so perhaps this is not visible with more modern (faster) computers.

Running the tests through mvn quarkus:dev does not exhibit that problem (the logs all end up in the same file).

Expected behavior

A single file contains all the log entries.

Actual behavior

The log entries are dispatched among two files, and one logging statement is missing entirely.

How to Reproduce?

https://github.com/oliviercailloux/Diet-server/tree/dupl-log

Output of uname -a or ver

Linux saucisson 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.3" 2022-04-19

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.8.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.6.3

Additional information

AMD® Athlon(tm) ii x2 250 processor × 2

@oliviercailloux oliviercailloux added the kind/bug Something isn't working label May 6, 2022
@JiriOndrusek
Copy link
Contributor

I've encountered a similar problem (but with different use-case).

I wanted to configure different file to log into. I changed appropriate application.properties. (quarkus.log.file.enable=true and
quarkus.log.file.path=target/test.log)

The result is, that my custom file target/test.log contains only 1 line. The rest of the log is present in target/quarkus.log.

(Problem can be easily simulated from my fork of quarkus-quickstarts - getting-started https://github.com/JiriOndrusek/quarkus-quickstarts/tree/logging_error/getting-started)

@famod
Copy link
Member

famod commented Jul 11, 2022

@JiriOndrusek sounds familiar: #10233 (link fixed)

@JiriOndrusek
Copy link
Contributor

@famod thanks for the link!

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

No branches or pull requests

4 participants