Redirecting the logging output

By default, the trace system sends the logging information to either

  • System.out

  • System.err

To redirect the logging output to a file, use the following property.

com.entrust.toolkit.trace.filename=<file>

For example:

com.entrust.toolkit.trace.filename=C:\jtklog.log

You can also create a new logging class that extends OutputStreamTraceLog – for example:

public class FileLogger extends OutputStreamTraceLog {
// default log location
private static String m_fileName = "C:\\logs\\toolkit.out";
 
public FileLogger(String name) throws FileNotFoundException {
super(name);
setStream(new FileOutputStream(m_fileName));
}
 
// method to set the desired log location
public static void setFileName(String filename) {
m_fileName = filename;
}
}

To indicate which logging class the toolkit should use, set the logclass system property – for example:

-D com.entrust.toolkit.tracing.logclass=com.company.utils.FileLogger