I wrote this initially in about 1994 just as a basic "dump text to file" unit and it's grown from there into a robust threaded logging component that can handle quite high volumes of logging calls from multithreaded applications. mozdebuglog8.7z is current as of 2008 and I'm about to update it because I need it in my current job. I think it will work as is, but I haven't tested it so I'm not promising anything.
The other files have older versions, probably including a log-to-database version and one with a heap of log entry types so you can change the volume of logging at runtime.
I will, of course, update this page, possibly even this year.