Kiwi Syslog Daemon provides the ability to format log files using custom file formats, one of which is XML. To setup Kiwi Syslog Daemon to log in XML format:
There you have it! The 'Log to file' action will now create entries in the log file that appear in the following format: eg. 10%2F05%2F200610:22:01 (etc) Unfortunately, this type of log file - although XML-like in appearance, is not 100% XML compliant. The reason? Well, it has to do with two things: For one thing, XML requires a root tag in order to be parsed correctly by most XML parsers. And, because of the way that the XML log is being created - that is, in real time - there isn't any trailing termination tag. The following method describes how to ensure that we end up with an XML-compliant log file. (Suitable for viewing in Internet Explorer or the like.) Assume that we have a log file generated by Kiwi Syslog Daemon, by the method descibed above i.e. formatted to an XML custom format, and that the file is named: "logfile.xml". STEP 1: Create a separate XML file that includes "logfile.xml" as an ENTITY. Name the file "XML_Logfile_Wrapper.xml", it's content as follows:
Ensure that XML_logfile_wrapper.xml and logfile.xml are in the same directory, and you have yourself a 100% compliant XML document. Just open XML_logfile_wrapper.xml to see for yourself. Add in a stylesheet reference, and you have something that looks a little nicer on screen.
The wrapper file (XML_logfile_wrapper.xml), a simple stylesheet (syslogd.css) and a sample logfile (logfile.xml) have been included in the following Zip-file. Happy Syslogging! |
