This package makes it possible to view and query log files written by Tracy Debugger, part of the Nette Framework for PHP, using Microsoft Log Parser.
A COM Plug-In is implemented to parse Tracy log files. Obviously, it'll work only on Windows.
After you've downloaded the SCT file from this package, it must be registered using the following syntax:
%SystemRoot%\Syswow64\regsvr32 Tracy.LogParser.Scriptlet.sct
Note the path to regsvr32 executable used, it is needed to work correctly on 64bit Windows. Regsvr32 expects a valid path to the SCT file, so either run the command from the directory where you've placed the file or use the full path.
To use the Plug-In, run Log Parser with parameters that tell it to use this COM Plug-In, for example:
logparser "SELECT * FROM 'C:\foo\exception.log' WHERE TO_DATE(DateTime) = SYSTEM_DATE()" -i:COM -iProgID:Tracy.LogParser.Scriptlet
To unregister the Plug-In, use this command:
%SystemRoot%\Syswow64\regsvr32 /u Tracy.LogParser.Scriptlet.sct
Tracy log files contain the following notable features:
DateTime Message @ Request [ @@ ExceptionFile]
DateTime
in[YYYY-MM-DD HH:MM:SS]
format (wrapped in square brackets)Message
is any text message, for error and exception logs this is the respective error messageRequest
is a request URL or CLI command that have originally executed the script, separated by@
from the previous partExceptionFile
, only found in exception logs, states a file name, in which exception details, such as stack trace, can be found. It is separated by@@
from the previous part.
This COM Plug-In is heavily based on tutorials by Robert McMurray on Microsoft blog, especially:
- Advanced Log Parser Charts Part 4 – Adding Custom Input Formats
- Advanced Log Parser Part 6 – Creating a Simple Custom Input Format Plug-In
- Advanced Log Parser Part 7 – Creating a Generic Input Format Plug-In
It would not have been possible to create this Plug-In without these. Also, last time I was writing anything in VB was well more than 10 years ago, so there are bound to be some gotchas with this work.
This work is released under the MIT License. See LICENSE.md for details.