This allows logging(Log4J) to preserve the old log after the server is restarted.
Replace the following code in config\log-config.xml -
Existing code shown in your log-config.xml for the Server.log appender -
<appender name="Server" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="../log/server.log"/>
<param name="Append" value="false"/>
<param name="Encoding" value="UTF-8"/>
<param name="MaxBackupIndex" value="5"/>
<param name="MaxFileSize" value="500KB"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d{ISO8601},%t,%-5p, %c{2} - %m%n"/>
</layout>
</appender>
Change the above code to(Append value = true) -
<appender name="Server" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="../log/server.log"/>
<param name="Append" value="true"/>
<param name="Encoding" value="UTF-8"/>
<param name="MaxBackupIndex" value="5"/>
<param name="MaxFileSize" value="500KB"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d{ISO8601},%t,%-5p, %c{2} - %m%n"/>
</layout>
</appender>
Note: This also applies to the rest of the appender - JDBC, Jetty, Activity & Job logs.