Description
I'm trying to configure a rolling file appender to work with HTMLLayout:
<RollingRandomAccessFile name="RollingFile" fileName="logs/app.html" filePattern="logs/app-%i-%d{yyyy-MM-dd-HH}.html"> <HTMLLayout title="App log" locationInfo="true"/> <Policies> <TimeBasedTriggeringPolicy interval="12" /> <SizeBasedTriggeringPolicy size="10 MB" /> <OnStartupTriggeringPolicy /> </Policies> <DefaultRolloverStrategy max="100" /> </RollingRandomAccessFile>
But the outcome is not as expected. The logs are not formatted in a nice table and when I open the log file as text the HTML header is missing.
When I use FileAppender it works fine.
<File name="FileAppender" fileName="logs/agent.html"> <HTMLLayout title="Agent log" locationInfo="true" /> </File>
Attachments
Issue Links
- is related to
-
LOG4J2-581 No header output in RollingRandomAccessFile
- Closed
-
LOG4J2-675 RollingFile and RollingRandomAccessFile don't write footer before rollover
- Closed