com.sap.tc.loggingStandard
Class LogManager

java.lang.Object
  |
  +--com.sap.tc.loggingStandard.LogManager

public class LogManager
extends java.lang.Object

This class is similar to java.util.logging.LogManager.

It contains mainly the factory methods that retrieves the unique instance of itself and creates Logger instance, plus methods that will affect the message output: severity level setting. Other configuration methods are not included.


Method Summary
 Level getLevel(java.lang.String name)
          Get the log level for a given logger name.
 Logger getLogger(java.lang.String name)
          Method to find a named logger.
 java.util.Enumeration getLoggerNames()
          Get an enumeration of known logger names.
static LogManager getLogManager()
          Return the unique, global LogManager.
 void setLevel(java.lang.String name, Level level)
          Set a log level for a given set of loggers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogManager

public static LogManager getLogManager()
Return the unique, global LogManager.

getLogger

public Logger getLogger(java.lang.String name)
Method to find a named logger. Note that since untrusted code may create loggers with arbitrary names this method should not be relied on to find Loggers for security sensitive logging.

Parameters:
name - name of the logger
Returns:
matching logger or null if none is found

getLoggerNames

public java.util.Enumeration getLoggerNames()
Get an enumeration of known logger names.

Note: Loggers may be added dynamically as new classes are loaded. This method only reports on the loggers that are currently registered.

Returns:
enumeration of logger name strings

getLevel

public Level getLevel(java.lang.String name)
Get the log level for a given logger name. See the setLevel method for more details.
Parameters:
name - The logger name
Returns:
the log level

setLevel

public void setLevel(java.lang.String name,
                     Level level)
              throws java.lang.SecurityException
Set a log level for a given set of loggers. Subsequently the target loggers will only log messages whose types are greater than or equal to the given level. The level value Level.OFF can be used to turn off logging.

A setLevel() from Manager will FORCE the update of severity on the specified logger and its children.

The empty string "" can be used to identify the root.

Parameters:
name - The logger name to update.
level - the new log level, e.g. Level.SEVERE or Level.FINER
Throws:
java.lang.SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control").