Honor logging.path config in filePattern for Log4j2 RollingFile
Previously, rolled over files were always written to logs/. This commit ensures that rotated logs are written into the directory specified in the application config's logging.path property. Closes gh-10554
This commit is contained in:
committed by
Andy Wilkinson
parent
c0d9adce7e
commit
7441d6bd86
@@ -11,7 +11,7 @@
|
||||
<Console name="Console" target="SYSTEM_OUT" follow="true">
|
||||
<PatternLayout pattern="${sys:CONSOLE_LOG_PATTERN}" />
|
||||
</Console>
|
||||
<RollingFile name="File" fileName="${sys:LOG_FILE}" filePattern="logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
|
||||
<RollingFile name="File" fileName="${sys:LOG_FILE}" filePattern="${sys:LOG_PATH}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
|
||||
<PatternLayout>
|
||||
<Pattern>${sys:FILE_LOG_PATTERN}</Pattern>
|
||||
</PatternLayout>
|
||||
|
||||
Reference in New Issue
Block a user