I have a logback appender:
<appender name="logfile"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>/opt/loghome/recon/log.%d{MM-dd-yyyy}.log </fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<append>false</append>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
I would like to change /opt/loghome/recon/log.%d{MM-dd-yyyy}.log.zip so that the log will be created in src/main/resources in my project. The aim of this is to then have the log on the classpath. Can this be done?
Thanks
I guess you’re using maven.
Maven builds jars/wars/ears whatever
The jars don’t contain src/main/resources
In fact this src/main/resources path doesn’t exist once your project is compiled.
So I don’t really get this idea to put your logs into src/main/resources.
I think its much more “healthy” to include your /opt/loghome/recon/ in the classpath when you’re running your project.
Does it make sense?