Background
Error loading this property because it is populated only by tomcat. It is not populated with the maven compile job .
Solution 1
Set a property like this in logback.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration> <if condition='isDefined("catalina.home")'> <then> <property name="log.folder" value="${catalina.home}/logs"/> </then> <else> <property name="log.folder" value="./target/logs"/> </else> </if> <appender name="companyMyAppServiceAppender" class="ch.qos.logback.core.FileAppender"> <file>${log.folder}/company.myApp.log</file> ... </appender> ... </configuration>
This will create the log files in the target folder at compile time, which will be deleted using clean.
Decision 2
The value of "Rewrite":
<property name="log.folder" value="./target/logs"/> <if condition='isDefined("catalina.home")'> <then> <property name="log.folder" value="${catalina.home}/logs"/> </then> </if>
NB!
And don't forget to import maven janino dependency
<dependency> <groupId>org.codehaus.janino</groupId> <artifactId>janino</artifactId> <version>2.7.8</version> </dependency>
Globber
source share