9.0 Logging Debug Messages

The com.novell.emframe.dev.D (Debug) class provides a simple mechanism for plug-ins to log debug messages to the screen, a file, or both. Writing the log occurs asynchronously. The log methods simply queue the event and return immediately—the actual writing is done later by a separate thread. Three levels of logging are supported: info, warning, and error. Only messages with a priority level greater than or equal to the current level are logged. Those with a lower priority are discarded.

The following table describes the properties used to control logging.

Table 9-1 com/novell.emframe.dev.D members

Property

Description

void log(String)

Overloaded. Logs a message.

String getLogFileName()

Returns the name of the log file

boolean isDebugEnabled()

Returns true if logging is enabled for INFO level

int getLoggingLevel()

Returns the logging priority level

boolean getLoggingToFile()

Returns true if logging to file is enabled

boolean getLoggingToErr()

Returns true if logging to System.err is enabled

boolean getLoggingToOut()

Returns true if logging to System.out is enabled

void setLoggingLevel(int)

Sets the logging priority level

void setLoggingToFile(boolean)

Enables/disabled logging to file

void setLoggingToErr(boolean)

Enables/disables logging to System.err

void setLoggingToOut(boolean)

Enables/disables logging to System.out

If messages are logged to a file, they are logged to a standard text file <iManager Home>/bin/iManager.log as well as to an HTML file (webapps/nps/WEB-INF/logs/debug.html).The HTML log is formatted as a single HTML <table> element with each log message formatted as a single row in the table. The table remains unclosed (no closing </table> tag) so that additional log messages can be added. Although the table and document remain unclosed, the file can still be view with any web browser or text editor.

To view the HTML log from iManager, browse to the iManager Server > Configure iManager, and select the Logging Events tab.