This API will allow a developer to configure and use logging in Content Server.


Class Attributes Index

 o CS_LOGGER_NAME_PREFIX
The logger name prefix for all Content Server loggers.
 o LEVEL_OFF
Log level output is disabled. Nothing will be logged.
 o LEVEL_FATAL
Only FATAL log messages will be logged.
 o LEVEL_ERROR
Only ERROR log messages and higher will be logged.
 o LEVEL_WARN
Only WARN log messages and higher will be logged.
 o LEVEL_INFO
Only INFO log messages and higher will be logged.
 o LEVEL_DEBUG
Only DEBUG log messages and higher will be logged.
 o LEVEL_TRACE
Only TRACE log messages and higher will be logged.
 o LEVEL_ALL
All message levels will be logged.
 o OK
Success return constant.

Class Methods Index

 o GetLoggerNames( String loggerPrefix [, Boolean collapse ] )
Gets the master list of loggers defined in Content Server.
 o GetLogLevel( String loggerName )
Gets the current level for the given logger (LEVEL_OFF if the logger doesn't exist).
 o SetLogLevel( String loggerName, Integer logLevel )
Sets the current level for the given logger.
 o LogLevelToString( Integer logLevel )
Gets a string description for the given log level.

Class Attributes

 o CS_LOGGER_NAME_PREFIX
 String CS_LOGGER_NAME_PREFIX

The logger name prefix for all Content Server loggers.

 o LEVEL_OFF
 Integer LEVEL_OFF

Log level output is disabled. Nothing will be logged.

 o LEVEL_FATAL
 Integer LEVEL_FATAL

Only FATAL log messages will be logged.

 o LEVEL_ERROR
 Integer LEVEL_ERROR

Only ERROR log messages and higher will be logged.

 o LEVEL_WARN
 Integer LEVEL_WARN

Only WARN log messages and higher will be logged.

 o LEVEL_INFO
 Integer LEVEL_INFO

Only INFO log messages and higher will be logged.

 o LEVEL_DEBUG
 Integer LEVEL_DEBUG

Only DEBUG log messages and higher will be logged. Debug level is reserved for internal debugging messages. Enabling this level could have a severe impact on program performance.

 o LEVEL_TRACE
 Integer LEVEL_TRACE

Only TRACE log messages and higher will be logged. Trace level is reserved for internal function-level trace debugging. Enabling this level will have a severe impact on program performance.

 o LEVEL_ALL
 Integer LEVEL_ALL

Messages for all log levels will be logged.

 o OK
 Integer OK

Success return constant.

Class Methods

 o GetLoggerNames
 List GetLoggerNames(
            String loggerPrefix, 
            [ Boolean collapse=TRUE ] )

Gets the master list of loggers defined in Content Server.

Parameters:
loggerPrefix  -  The prefix logger name to match (for example, "com.opentext.contentserver"
would match any logger name that started with this string.
collapse  -  True if logger names containing numbers should be collapsed, false if
each should be returned separately.
For example, application.logger.[1], application.logger.[2] are defined in the system.
If collapse is true, the logger list will only contain application.logger.
Returns:
A List containing the logger names if successful. If the function fails,
an error code will be returned.

 o GetLogLevel
 Integer GetLogLevel(
            String loggerName )

Gets the current level configured for the given logger.

Parameters:
loggerName  -  The name of the logger to get the current level for.
Returns:
An Integer representing the current log level. Logging.LEVEL_OFF if the logger doesn't exist.

 o SetLogLevel
 Integer SetLogLevel(
            String loggerName )
            Integer logLevel )

Sets the log level for the given logger.

Parameters:
loggerName  -  The name of the logger whose level is to be set.
logLevel  -  The level to set.
Returns:
Logging.OK (Integer zero) if successful; Error otherwise.

 o LogLevelToString
 String LogLevelToString(
        Integer logLevel )

Gets a (localized) description string for a given log level.

Parameters:
logLevel  -  The log level to get a description for.
Returns:
A String representation of the given log level.