You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "lital kornfeld (JIRA)" <ji...@apache.org> on 2014/03/17 13:43:42 UTC

[jira] [Created] (LOG4J2-569) Configuring RollingRandomAccessFile with HTMLLayout does not work as expected

lital kornfeld created LOG4J2-569:
-------------------------------------

             Summary: Configuring RollingRandomAccessFile with HTMLLayout does not work as expected
                 Key: LOG4J2-569
                 URL: https://issues.apache.org/jira/browse/LOG4J2-569
             Project: Log4j 2
          Issue Type: Bug
          Components: Appenders, Layouts
    Affects Versions: 2.0-rc1
            Reporter: lital kornfeld


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>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org