RussellJNile
RussellJNile

Reputation: 31

Log4j2 RollingFile doesn't work when using ${sys:jboss.server.log.dir}

Everything works fine when I have a rolling file configured as so:


RollingFile name="RollingFileAppender" fileName="/applicationLogs/CTMSApplicationService-${hostName}.log" filePattern="/applicationLogs/CTMSApplicationService-${hostName}-%d{MM-dd-yyyy}-%i.log"


BUT as soon as I use the ${sys:jboss.server.log.dir} for the "root" of my log location the primary log gets created but nothing ever rolls. The log file just gets appended to:


RollingFile name="RollingFileAppender" fileName="${sys:jboss.server.log.dir}/CTMSApplicationService-${hostName}.log" filePattern="${sys:jboss.server.log.dir}/CTMSApplicationService-${hostName}-%d{MM-dd-yyyy}-%i.log">


The value of ${sys:jboss.server.log.dir}="E:\Wildfly-8.1.0.Final\standalone\log"

Is it because the fileName can handle the Winblows "E:\" and the filePattern can not?

Upvotes: 1

Views: 2609

Answers (1)

Remko Popma
Remko Popma

Reputation: 36754

This may be caused by this issue: https://issues.apache.org/jira/browse/LOG4J2-829 This is fixed in the master branch and will be included in the upcoming 2.1 release.

Upvotes: 0

Related Questions