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

${my.property:-default} style defaults defined in logback.xml do not work #39

Closed
ppalaga opened this issue Jun 30, 2020 · 2 comments
Closed
Milestone

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Jun 30, 2020

I wanted to add something like the following to logback.xml, but it does not work

  <!-- Allow increasing mvnd log level from command line -->
  <logger name="org.jboss.fuse.mvnd" level="${mvnd.log.level:-INFO}" />

With the above setting and -Dmvnd.log.level=DEBUG passed via CLI, the log level is not set to DEBUG.

When I change it to

  <logger name="org.jboss.fuse.mvnd" level="${mvnd.log.level}" />

-Dmvnd.log.level=DEBUG works as expected, but building without -Dmvnd.log.level=DEBUG (as expected per logback docs) leads to org.jboss.fuse.mvnd being set to DEBUG anyway, which is not nice.

@gnodet
Copy link
Contributor

gnodet commented Nov 17, 2020

That may have been fixed by 59a9bba

@gnodet
Copy link
Contributor

gnodet commented Nov 17, 2020

I found what is happening. The daemon JVM is launched first without any specific system properties from the command line, so when the logback configuration is loaded, the mvnd.log.level is not set.
The workaround is to use mvnd.jvmArgs="-Dmvnd.log.level=DEBUG" in one of the mvnd.properties file or on the command line using -Dmvnd.jvmArgs="-Dmvnd.log.level=DEBUG". Note that the mvnd.jvmArgs is a discriminating property, so a specific daemon will be created.

@gnodet gnodet closed this as completed Nov 17, 2020
@ppalaga ppalaga added this to the 0.0.13 milestone Nov 17, 2020
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

No branches or pull requests

2 participants