When I created an application framework for .NET 1.0 back in 2001 for my then employer 'Saltmine UK or Smuk' it also had a logging component and any errors were logged to the file system or database in a specific XML format.
Several years and frameworks later, I am still using the same format and now that some of my small projects are public, it seemed helpful to have the viewer online as well.
Error logs are written into files named 'errorlogYYYY-MM-DD.xml' with the current date, copy the
logviewer.hta file into the same directory as the log files and double-click it.
It lists all files with an XML extension and tries to show their formatted content. That's all.
Log viewer first looks for a folder named 'logs' in the same directory as itself. 'Logs' is the default logs folder for all my applications. If a 'logs' folder is found, it tries to enumerate the log files inside. If no 'logs' folder exists, it tries enumerate *.xml files in its own folder.
That means you have the choice of location for 'logviewer.hta', either in the same directory as the log files, or in the parent directory assuming the log files live in 'logs'.
I like to keep my 'logs' directory free of any other files so it is easier to clean it.
Log viewer uses a built-in XSLT Style sheet to transform the xml data in the log files.
It does also support external style sheet files. It first looks for a directory names 'xslt' in the same directory as itself and if found tries to load style sheet files from there. If it does not exist, it tries to load style sheet files from its own directory.
If it can't find anything there either, it uses the built in one
Log viewer supports other log files types. To transform the xml into html it looks for a
style sheet file that corresponds to the name of the log file.
It removes the date part from the filename and replaces 'xml' with 'xsl'
For an error log file with the name 'errorlog2005-08-30.xml' it looks for 'errorlog.xsl', for something like 'mylog2013-02-06.xml' it would look for 'mylog.xsl' in the two locations described above.
- Windows XP or newer
Extract the single file into the same directory where your error log files live.