Package org.olat.core.logging

Logging

See:
          Description

Interface Summary
OLog Description:
TODO:
 

Class Summary
JavaScriptTracingController Description:
LogDelegator Description:
LogFile Description: logfile handling
LogHelper  
LogRealTimeViewerController Description:
The log real time viewer controller offers the possibility to live-view the log file.
OLogImpl Description:
Log Impl class, for method details see Tracing.java in the same package
Tracing This is the central place where all log information should pass.
 

Exception Summary
AssertException Description:
used when a bug is detected e.g.
DBRuntimeException A DBRuntimeException is an exception that occurred in database access.
KnownIssueException Use this exception when you want to identify a situation where an exception occurs that we want to treat as a known issues case.
OLATRuntimeException Description:
Thrown if an unrecoverable error occurs.
OLATSecurityException A DBRuntimeException is an exception that occurred in database access.
StaleObjectRuntimeException  
StartupException Description:
Used if anything goes badly wrong during application startzp.
 

Package org.olat.core.logging Description

Logging

The Tracing class is the frontend for log4j we use in OLAT. Use Tracing for all logging purposes in OLAT. Examples:

Tracing.logWarn("A warning message...", this.getClass());
If you add debug information you should put an if statement round the debug information like:
if(Tracing.isDebugEnabled(DemoController.class)){
        Tracing.logDebug("link clicked, log something to the olat.log file", DemoController.class);
}
Like this the compiler can optimize calls and you do not get a performance issue while using debugging information in your code.

Be carefull when using Tracing.logError(); In most cases when an error occurs like an ex. IOException it is more appropriate to throw an OLATRuntimeException() and stop to continue with the execution of this thread otherwise the error will let the system crash on an other place where is it often difficult to find the origin reason for the exception.

Javascript logging: You can use

if (B_AjaxLogger.isDebugEnabled()) {
// always test if in log debug before loggin!!
B_AjaxLogger.logDebug("This is a cool ajaxified debug message", "myjsfile.js");
} 
to debug and log javascript stuff to the olat.log file. To enable it set the loglevel in the log4j.properties file of the controller to debug
log4j.logger.org.olat.core.logging.JavaScriptTracingController=DEBUG