0

I'm using Pax Logging in Felix container, because the facility to configure logger with dynamically loaded property file org.ops4j.pax.logging.cfg looked appealing.

However, I can't get to use the environmental lookup as described in sister question about Log4j. I've noticed that Pax Logging has copied a large block of Log4j. Is the environmental lookup also supported?

The example to that I expect to work is:

log4j.appender.rolling = org.apache.log4j.DailyZipRollingFileAppender
log4j.appender.rolling.file = log/equinox-${sys:USERNAME}.log

I expect that file equinox-myuser.log is created, instead of that I get equinox-.log. So it seems that some engine tries to resolve the variable, but fails. The test was started under Windows, so variable USERNAME exists.

Community
  • 1
  • 1
9ilsdx 9rvj 0lo
  • 6,723
  • 7
  • 26
  • 66

1 Answers1

1

Ops4j uses env: prefix instead of sys: prefix.

The working sample should look like:

log4j.appender.rolling.file = log/equinox-${env:USERNAME}.log
9ilsdx 9rvj 0lo
  • 6,723
  • 7
  • 26
  • 66