Package org.objectweb.util.monolog.jul
Class SimpleLoggingFactory
- java.lang.Object
-
- org.objectweb.util.monolog.jul.SimpleLoggingFactory
-
- All Implemented Interfaces:
LoggingFactory
public class SimpleLoggingFactory extends Object implements LoggingFactory
-
-
Field Summary
Fields Modifier and Type Field Description private static StringCONSOLE_HANDLERprivate static booleandebugprivate static StringFILE_HANDLERprivate static StringFORMATprivate static StringHANDLERSprivate static StringLEVELprivate static StringLOGGERprivate static StringMEMORY_HANDLERprivate static StringOldLogFormatterprivate static Propertiespropsprivate static HashMap<String,Logger>sloggersprivate static StringSOCKET_HANDLER
-
Constructor Summary
Constructors Constructor Description SimpleLoggingFactory()Default constructor (required).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidconfigure(InputStream is)private static HandlercreateHandler(String classname, Properties props)LevelgetDebugLevel()Returns the Level object for DEBUG level.LevelgetErrorLevel()Returns the Level object for ERROR level.LevelgetFatalLevel()Returns the Level object for FATAL level.LevelgetInfoLevel()Returns the Level object for INFO level.private static IntegergetInteger(String name, String dflt)LoggergetLogger(String topic)Find or create a logger for a named subsystem.LevelgetWarnLevel()Returns the Level object for WARN level.voidinitialize(String debugDir, String debugFileName)The configuration file is first searched in the debugDir If not defined, the configuration file is then searched from the search path used to load classes.private static booleanisHandlerName(String name, Vector<String> handlers)Levelparse(String name)Returns the Level object corresponding to specified name.private static voidsetFilter(Handler handler, String classname)private static voidsetFormatter(Handler handler, String classname)
-
-
-
Field Detail
-
debug
private static boolean debug
-
HANDLERS
private static final String HANDLERS
- See Also:
- Constant Field Values
-
LEVEL
private static final String LEVEL
- See Also:
- Constant Field Values
-
LOGGER
private static final String LOGGER
- See Also:
- Constant Field Values
-
FORMAT
private static final String FORMAT
- See Also:
- Constant Field Values
-
OldLogFormatter
private static String OldLogFormatter
-
CONSOLE_HANDLER
private static final String CONSOLE_HANDLER
- See Also:
- Constant Field Values
-
FILE_HANDLER
private static final String FILE_HANDLER
- See Also:
- Constant Field Values
-
MEMORY_HANDLER
private static final String MEMORY_HANDLER
- See Also:
- Constant Field Values
-
SOCKET_HANDLER
private static final String SOCKET_HANDLER
- See Also:
- Constant Field Values
-
props
private static Properties props
-
-
Method Detail
-
getLogger
public Logger getLogger(String topic)
Description copied from interface:LoggingFactoryFind or create a logger for a named subsystem.- Specified by:
getLoggerin interfaceLoggingFactory- Parameters:
topic- A name for the logger. This should be a dot-separated name and should normally be based on the package name or class name of the subsystem.- Returns:
- a suitable Logger
-
getFatalLevel
public Level getFatalLevel()
Description copied from interface:LoggingFactoryReturns the Level object for FATAL level.- Specified by:
getFatalLevelin interfaceLoggingFactory- Returns:
- the Level object for FATAL level.
-
getErrorLevel
public Level getErrorLevel()
Description copied from interface:LoggingFactoryReturns the Level object for ERROR level.- Specified by:
getErrorLevelin interfaceLoggingFactory- Returns:
- the Level object for ERROR level.
-
getWarnLevel
public Level getWarnLevel()
Description copied from interface:LoggingFactoryReturns the Level object for WARN level.- Specified by:
getWarnLevelin interfaceLoggingFactory- Returns:
- the Level object for WARN level.
-
getInfoLevel
public Level getInfoLevel()
Description copied from interface:LoggingFactoryReturns the Level object for INFO level.- Specified by:
getInfoLevelin interfaceLoggingFactory- Returns:
- the Level object for INFO level.
-
getDebugLevel
public Level getDebugLevel()
Description copied from interface:LoggingFactoryReturns the Level object for DEBUG level.- Specified by:
getDebugLevelin interfaceLoggingFactory- Returns:
- the Level object for DEBUG level.
-
parse
public Level parse(String name)
Description copied from interface:LoggingFactoryReturns the Level object corresponding to specified name.- Specified by:
parsein interfaceLoggingFactory- Parameters:
name- The level name, for example DEBUG or FATAL.- Returns:
- the Level object corresponding to specified name.
-
initialize
public void initialize(String debugDir, String debugFileName)
The configuration file is first searched in the debugDir If not defined, the configuration file is then searched from the search path used to load classes.- Specified by:
initializein interfaceLoggingFactory
-
createHandler
private static Handler createHandler(String classname, Properties props) throws Exception
- Throws:
Exception
-
configure
private static void configure(InputStream is) throws Exception
- Throws:
Exception
-
-