Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
2.11.1
-
None
-
None
Description
Hi,
i'm trying to switch to Log4j from Logback.
In the configuration (the file appender), i'm using a system property that does not exist and is created in the contextListener (the logs path is generated at runtime and can't be set staticly in the config file)
<configuration debug="true"> <contextListener class="it.my.LoggerStartupListener"/> <appender name="JSON" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${LOG_PATH}/app.log</File> <FileNamePattern>${LOG_PATH}/app.%d{yyyy-MM-dd}.%i.log.gz </FileNamePattern> ...
public class LoggerStartupListener extends ContextAwareBase implements LoggerContextListener, LifeCycle { private static final String LOG_PATH = "LOG_PATH"; @Override public void start() { getContext().putProperty(LOG_PATH, Paths.get(OSUtils.getBasePath(), "logs").toString()); } }