0

The variable specifying logging level is declared in docker file, and when i inspect my container i can see my variable, even when i run docker exec container_id env | grep LOGGING_LEVEL | cut -d'=' -f2 i can see the value set to my variable which is WARN. Now, in log4j.properties file, i used ${LOGGING_LEVEL}, ${sys:LOGGING_LEVEL}, ${env:LOGGING_LEVEL}, and none worked, i can see in console logs of debug level.

Root logger option

log4j.rootLogger=${LOGGING_LEVEL}, file, stdout

I use log4j 1.2.17, my web application runs in a tomcat container, the console of intellij shows to me logs, when i run the project, i even check in target/classes/ directory that log4j.properties has been correctly edited, but nothing works.

Mathis Hobden
  • 356
  • 2
  • 7
  • 19

1 Answers1

0

I think your environment variable is not evaluated properly. Try: log4j.rootLogger=${env:LOGGING_LEVEL}, file, stdout.

See responses to a similar question here: How to give environmental variable path for file appender in configuration file in log4j

Ultcyber
  • 396
  • 1
  • 6