Replies: 2 comments
-
Hi @JamesBoon. The config overrides only accept simple string values and arrays of strings. Hence, they cannot be used to override the whole appenders object. The filter factories also work for other commands since they reside in I think the simplest solution for your use case is to use environment variables for the logging levels of the appenders. Then you can provide an environment variable with the value |
Beta Was this translation helpful? Give feedback.
-
Thank you @zUniQueX, that was the hint I needed! If anyone else needs it: appenders:
- type: console
threshold: ${DW_LOG_THRESHOLD_CONSOLE:-OFF}
# ...
- type: file
threshold: ${DW_LOG_THRESHOLD_FILE:-INFO}
# ... This way, the console logger is Just before anybody asks, yes the same thing can be achieved via passing system properties. But this should only be used if the number and order of the log appenders is always fixed! |
Beta Was this translation helpful? Give feedback.
-
Is there any way to redirect all log output to stdout instead of a configured file appender if I start any other command than
server
e.g. when runningcheck
?I saw the option to override
config.yml
settings by passing system properties.Changing a single appender works with something like this:
-Ddw.logging.appenders[0].type=console -Ddw.logging.appenders[0].logFormat="%msg%n"
But this only changes the first appender in the array. How would it look like if you want to replace the whole
appenders
array with a single appender? How can I remove any other appender?Else I thought maybe a FilterFactory would help, but it does not work with other commands than
server
.The only other way I see here is to have a different
config.yml
for my CLI commands - but I'd really like to use the same file.Am I missing something? Or is this a missing feature?
Beta Was this translation helpful? Give feedback.
All reactions