[logback-dev] [JIRA] Commented: (LBCORE-211) HTMLLayout and LayoutWrappingEncoder produces invalid/unusuable output

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Mon Jun 20 13:17:53 CEST 2011


    [ http://jira.qos.ch/browse/LBCORE-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12040#action_12040 ] 

Ceki Gulcu commented on LBCORE-211:
-----------------------------------

For the closing footer, you needs to close the appender which is usually done by closing the logger context, for example by invoking: 

import ch.qos.logback.classic.LoggerContext;
import org.slf4j.LoggerFactory;
...

  LoggerContext loggerContext  = (LoggerContext) LoggerFactory.getILoggerFactory();
  loggerContext  .stop()

As for the claim that "when using the append element, a new logging event produces the complete html header, headlines and table header", it is incorrect. I just have tested it with the configuration that you provided. There is no table header generated with each new logging event. Perhaps you meant to say that after restarting an application or resetting the logger context, the first logging event produces the complete html header. Is that it?




 

> HTMLLayout and LayoutWrappingEncoder produces invalid/unusuable output
> ----------------------------------------------------------------------
>
>                 Key: LBCORE-211
>                 URL: http://jira.qos.ch/browse/LBCORE-211
>             Project: logback-core
>          Issue Type: Bug
>    Affects Versions: 0.9.29
>         Environment: Windows Server 2008 R2 64 bit, JDK 1.6.0_26
>            Reporter: Jessica-Aileen Alten
>            Assignee: Ceki Gulcu
>
> HTMLLayout and LayoutWrappingEncoder are producing unusuable HTML output, the HTML file isn't closed by </table></body></html>. When you are using the append element, a new logging event produces the complete html header, headlines and table header.
> Configuration:
> <appender name="FILE" class="ch.qos.logback.core.FileAppender">
>         <file>../../logs/server_nodes.html</file>
>         <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
>             <layout class="ch.qos.logback.classic.html.HTMLLayout">
>                 <pattern>%d{ISO8601}%msg</pattern>
>             </layout>
>         </encoder>
>         <append>true</append>
>     </appender>
>  <logger name="file.logger" additivity="false">
>         <level value="info" />
>         <appender-ref ref="FILE" />
>     </logger>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list