Hello,
Tried log4j2.7, when stop/reload tomcat, html log file shows wrong format.
This happens only when there are already previous records in the html
log file.
Debug steps:
================
(1) run login and log one/two records in html format
(2) stop webapp
reinstalled webapp
start webapp
or just reload webapp
(3) run login and log record
test.html will be shown as:
<body bgcolor="#FFFFFF" topmargin="6" leftmargin="6">
<hr size="1" noshade="noshade">
Log session start time Fri Oct 07 10:42:05 EDT 2016<br>
<br>
<table cellspacing="0" cellpadding="4" border="1" bordercolor="#224466"
width="100%">
<tr>
<th>Time</th>
<th>Thread</th>
<th>Level</th>
<th>Logger</th>
<th>Message</th>
</tr>
<tr>
<td>237858</td>
<td title="http-bio-8080-exec-22 thread">http-bio-8080-exec-22</td>
<td title="Level"><font color="#339933">DEBUG</font></td>
<td title="ProcessLogin logger">ProcessLogin</td>
<td title="Message">2016-10-07 10:42:25 username: abc trying to login</td>
</tr>
</table>
<br>
</body></html>
<tr>
<td>344092</td>
<td title="http-bio-8080-exec-29 thread">http-bio-8080-exec-29</td>
<td title="Level"><font color="#339933">DEBUG</font></td>
<td title="ProcessLogin logger">ProcessLogin</td>
<td title="Message">2016-10-07 10:44:11 username: abc trying to login</td>
</tr>
"</table><br></body></html>" cause the html cannot be displayed correctly.
If this cannot be fixed, can someone let me know is there a way when
reinstall webapp or reload webapp from tomcat, there will always a new
log file generated?
Want to upgrade jars from 2.3 to new version; log4j2.3 never with this
problem.
Thanks a lot!
--
. tomcat 7.0.70
. log4j2.xml
<RollingFile name="debug_html"
fileName="@log4j.debug.html@"
filePattern="@log4j.debug.html@-%i.html">
<HTMLLayout charset="UTF-8" title="login_out_info" />
<Policies>
<SizeBasedTriggeringPolicy size="1 MB" />
<OnStartupTriggeringPolicy/>
</Policies>
</RollingFile>