Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
None
-
None
Description
Chris Hubing, lets discuss this first and see what adjustments we can make for 2.5 container
one last thing I've found - the log4j output from the daemon isn't picking up the ${ENV} or ${USERTOKEN} variables
7:55
for example, (copied from the base image), we have: log4j.appender.grouper_error.layout.ConversionPattern = grouper-api;grouper_error.log;${ENV};${USERTOKEN};%d{ISO8601}: [%t] %-5p %C{1}.%M(%L) - %x - %m%n
7:55
but the output from the container is:
7:55
grouper-api;grouper_error.log;;;2020-02-01 00:13:01,524: [DefaultQuartzScheduler_Worker-4] ...
7:56
log4j.appender.grouper_error.file = /tmp/logpipe
7:56
I just started looking into this, so I haven't figured out the problem yet
Andy Morgan 8:25 PM
according to https://stackoverflow.com/questions/201188/using-system-environment-variables-in-log4j-xml-configuration, it's not possible to use environment variables in log4j v1.x, only in v2.x
!https://slack-imgs.com/?c=1&o1=wi32.he32.si&url=https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2Fimg%2Fapple-touch-icon.png%3Fv%3Dc78bd457575a|width=16,height=16!Stack Overflow
Using system environment variables in log4j xml configuration
Is it possible to reference system environment variables (as opposed to Java system properties) in a log4j xml configuration file? I'd like to be able to do something like: <level value="${env.
8:26
I was able to get the logging working by using system properties defined in apiBinary/bin/setenv.sh:
8:26
GSH_JVMARGS="-DENV=${ENV} -DUSERTOKEN=${USERTOKEN}"
8:27
Then, log4j.properties will replace ${ENV} and ${USERTOKEN}
8:27
maybe this change can be part of the default setenv.sh from the grouper image