[logback-dev] [JIRA] Created: (LBCORE-208) No <meta http-equiv> header for log file is written by HTMLLayoutBase

Vladislav Rastrusny (JIRA) noreply-jira at qos.ch
Mon May 9 01:19:51 CEST 2011

No <meta http-equiv> header for log file is written by HTMLLayoutBase

                 Key: LBCORE-208
                 URL: http://jira.qos.ch/browse/LBCORE-208
             Project: logback-core
          Issue Type: Improvement
          Components: Layout
    Affects Versions: 0.9.9
         Environment: Java
            Reporter: Vladislav Rastrusny
            Assignee: Logback dev list
            Priority: Minor

When you use HTMLLayout for log files, logback only sets this HTML header:

{code}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <title>Logback Log Messages</title>
<style  type="text/css">


But if the log file contains symbols beyond ASCII range, some browsers can incorrectly set encoding displaying the file. My FireFox assumed my log file is in ISO-8859-5 when displaying it to me.

Since Java strings are UTF-16 and log is composed of strings, it seems desired to have something like

{code}<meta http-equiv="Content-Type" content="text/html; charset=utf-16">{code}

in the HTML header. To add this functionality you only need to patch  logback-core-0.9.28-sources.jar\ch\qos\logback\core\html\HTMLLayoutBase.getFileHeader() method adding this string to the list.

But it would also be desired to have file header customizable from config file.

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