Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-569

Configuring RollingRandomAccessFile with HTMLLayout does not work as expected

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc1
    • Fix Version/s: 2.0-rc2
    • Component/s: Appenders, Layouts
    • Labels:

      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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                litalk lital kornfeld
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: