4.10.4  Writing Log Messages in Custom Code

Use the java.util.logging.Logger class to write log messages in your custom implementations, e.g., Custom Security Provider.

Use the getLogger(String name) method to get an instance of the logger, for example,

private static final Logger logger = Logger.getLog(MyClass.class.getName());

To check if a certain level is loggable, use the inetsoft.util.LogUtil class, for example,

if(LogUtil.isLoggable(logger, Level.TRACE)) {

   logger.log(Level.WARNING, "Task failed", excp);

}

else {

   logger.log(Level.WARNING,"Task failed");

}

<< 4.10.3 Advanced Log Configuration © 1996-2013 InetSoft Technology Corporation (v11.5) 4.10.5 Implementing a Custom Log Handler >>