It maintains multiple versions of the log file, automatically deleting the oldest log file when the configured number of log files has been reached. The files are automatically renamed each time JBuilder is run. So in a typical configuration, the log file for the current or most recent JBuilder session will be "JBuilder.log", the log file for the previous session will be "JBuilder-1.log", the one before that "JBuilder-2.log", etc.
System.setOut() and
System.setErr() methods to redirect the program
output to the new log file.
main() method of JBuilder's main class.
JBLogger.jar file must be
added to the class path, and JBLogger's main program must be run instead
of JBuilder's main program. See the Installation
section below for details on how to do this.JBuilder.config file.
| Property Name | Default Value | Description |
|---|---|---|
| JBLogger.logPrefix | "../JBuilder" |
Defines the prefix for the log file name. This may include a
directory specification. If a relative directory is specified,
it will be resolved relative to JBuilder's "user.dir" directory,
which normally is the JBuilder /bin directory.
|
| JBLogger.logSuffix | ".log" | Defines the suffix for the log file name. |
| JBLogger.logSeparator | "-" | Defines the string that separates the prefix from the version number in renamed versions of the log file. |
| JBLogger.logCount | 20 | Specifies the number of log file versions to keep. |
| JBLogger.mainClass | "com.borland.jbuilder.JBuilder" | Specifies the class that JBLogger transfers control to after renaming and creating the log files and diverting output to the new log file. |
JBLogger.jar to the JBuilder /lib/ext
directory. This will cause the JBuilder launcher to add the JAR file to
JBuilder's class path.
Second, you must modify the "JBuilder.config" file in the JBuilder /bin
directory. Comment out the existing "mainclass" entry (which tells the
launcher to run JBuilder's main class), and ad a new one that tells the
launcher to run JBLogger.jar's main class. For example:
#mainclass com.borland.jbuilder.JBuilder mainclass net.jpmcgrath.jblogger.JBLoggerFinally, use the "vmparam" option to specify properties to configure JBLogger. For example:
vmparam -DJBLogger.logPrefix=D:/Logs/JBuilder vmparam -DJBLogger.logCount=20