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 "Remko Popma (JIRA)" <ji...@apache.org> on 2014/07/11 08:10:05 UTC

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

     [ https://issues.apache.org/jira/browse/LOG4J2-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-569:
-------------------------------

    Description: 
I'm trying to configure a rolling file appender to work with HTMLLayout:
{code}
<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>
{code}

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.
{code}
<File name="FileAppender" fileName="logs/agent.html">
        <HTMLLayout title="Agent log" locationInfo="true" />
</File>
{code}

  was:
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>


> 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
>              Labels: Rollover
>
> I'm trying to configure a rolling file appender to work with HTMLLayout:
> {code}
> <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>
> {code}
> 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.
> {code}
> <File name="FileAppender" fileName="logs/agent.html">
>         <HTMLLayout title="Agent log" locationInfo="true" />
> </File>
> {code}



--
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