Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-285

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

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None
    • Java

    Description

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

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

      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

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

      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.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            fractalizer Vladislav Rastrusny
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: