Project Description
binaries and source to do string-tracing from code written in sun java, like JDK 1.4.2.
Write trace or log messages, decode trace.


Often logging to text file is good enough. Sometimes, however, a combination of the following is needed:
- Log to a file from multiple thread;
- Log to a file from multiple processes;
- High-speed logging, while cannot buffer logging records (some will be lost if app crashes)
- Turn on and off logging without restarting app

The loglib.dll is providing this functionality (by using ETW).
Sample java code is:

lic class test
{
public static void main(String[] args)
{
log("test starts");
log("test starts");
log("test starts");
System.loadLibrary("loglib1.dll");
log("library loaded");
// init
loglib.initializeEtw("xxx", "c:\\xxx.etl");
log("initialized");

// write
loglib.writeEtw("xxxxxxxxxxxxx");
log("wrote events");

// stop
loglib.stopEtw();
log("stopped");

// decode
loglib.decodeEtw("xxx", "c:\\xxx.etl", "c:\\xxx.etl");
log("decoded");

log("test ends");
}
static void log(String message)
{
System.out.println(message);
}

All source code is in the attached zip file. The zip file is uploaded as Patch (see Source Code tab).


Last edited Dec 7, 2007 at 12:14 AM by sergeim, version 3