public class SimpleLoggingFactory extends Object implements LoggingFactory
Modifier and Type | Field and Description |
---|---|
private static String |
CONSOLE_HANDLER |
private static boolean |
debug |
private static String |
FILE_HANDLER |
private static String |
FORMAT |
private static String |
HANDLERS |
private static String |
LEVEL |
private static String |
LOGGER |
private static String |
MEMORY_HANDLER |
private static String |
OldLogFormatter |
private static Properties |
props |
private static HashMap<String,Logger> |
sloggers |
private static String |
SOCKET_HANDLER |
Constructor and Description |
---|
SimpleLoggingFactory()
Default constructor (required).
|
Modifier and Type | Method and Description |
---|---|
private static void |
configure(InputStream is) |
private static Handler |
createHandler(String classname,
Properties props) |
Level |
getDebugLevel()
Returns the Level object for DEBUG level.
|
Level |
getErrorLevel()
Returns the Level object for ERROR level.
|
Level |
getFatalLevel()
Returns the Level object for FATAL level.
|
Level |
getInfoLevel()
Returns the Level object for INFO level.
|
private static Integer |
getInteger(String name,
String dflt) |
Logger |
getLogger(String topic)
Find or create a logger for a named subsystem.
|
Level |
getWarnLevel()
Returns the Level object for WARN level.
|
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.
|
private static boolean |
isHandlerName(String name,
Vector<String> handlers) |
Level |
parse(String name)
Returns the Level object corresponding to specified name.
|
private static void |
setFilter(Handler handler,
String classname) |
private static void |
setFormatter(Handler handler,
String classname) |
private static boolean debug
private static final String HANDLERS
private static final String LEVEL
private static final String LOGGER
private static final String FORMAT
private static String OldLogFormatter
private static final String CONSOLE_HANDLER
private static final String FILE_HANDLER
private static final String MEMORY_HANDLER
private static final String SOCKET_HANDLER
private static Properties props
public SimpleLoggingFactory()
public Logger getLogger(String topic)
LoggingFactory
getLogger
in interface LoggingFactory
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.public Level getFatalLevel()
LoggingFactory
getFatalLevel
in interface LoggingFactory
public Level getErrorLevel()
LoggingFactory
getErrorLevel
in interface LoggingFactory
public Level getWarnLevel()
LoggingFactory
getWarnLevel
in interface LoggingFactory
public Level getInfoLevel()
LoggingFactory
getInfoLevel
in interface LoggingFactory
public Level getDebugLevel()
LoggingFactory
getDebugLevel
in interface LoggingFactory
public Level parse(String name)
LoggingFactory
parse
in interface LoggingFactory
name
- The level name, for example DEBUG or FATAL.public void initialize(String debugDir, String debugFileName)
initialize
in interface LoggingFactory
private static Handler createHandler(String classname, Properties props) throws Exception
Exception
private static void configure(InputStream is) throws Exception
Exception
Copyright © 2023 ScalAgent D.T.. All rights reserved.