Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
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.