com.cafesoft.core.log
Class Log4JAppenderFactory
java.lang.Object
|
+--com.cafesoft.core.log.Log4JAppenderFactory
- public final class Log4JAppenderFactory
- extends Object
Creates and initializes Log4j Appender objects that can then
be used by any object that implements the Log4JLogger interface
The Appenders created by the factory and the initialization
properties for each Appender are listed below.
- RollingFileAppender - FileAppender that rolls over when a maximum file
size is reached
- logger.layout.class - (OPTIONAL) the fully qualified name of
the Layout object class. If not specified, the default value is
"org.apache.log4j.SimpleLayout".
- logger.layout.pattern - (OPTIONAL) if the value for the
"logger.layout.class" is "org.apache.log4j.PatternLayout" this property
specifies the "ConversionPattern" to use with the Layout object
- logger.file.path - (REQUIRED) the file to which log messages are
written.
- logger.file.append - (OPTIONAL) if "true" or not specified,
messages are appended to an existing file. If "false" the destination
file is cleared before logging starts.
- logger.file.bufferedIO - (OPTIONAL) if "true" or not specified,
buffered IO is when writing to the file, which can radically improve
performance. If "false" then buffered IO is not used.
- logger.file.bufferSize - (OPTIONAL) the number of bytes in the
output buffer (used if buffered IO is enabled).
- logger.file.maxSize - (OPTIONAL) the maximum size of the file
(in bytes) before it is rolled over. If not specified, (1MB)
is used.
(See org.apache.log4j.RollingFileAppender.setMaxFileSize(String value)).
- Standard Output Appender - this is a ConsoleAppender that uses the
Standard Out Stream
- logger.layout.class - (OPTIONAL) the fully qualified name of
the Layout object class. If not specified, the default value is
"org.apache.log4j.SimpleLayout".
- logger.layout.pattern - (OPTIONAL) if the value for the
"logger.layout.class" is "org.apache.log4j.PatternLayout" this property
specifies the "ConversionPattern" to use with the Layout object
- Standard Error Appender - this is a ConsoleAppender that uses the
Standard Error Stream
- logger.layout.class - (OPTIONAL) the fully qualified name of
the Layout object class. If not specified, the default value is
"org.apache.log4j.SimpleLayout".
- logger.layout.pattern - (OPTIONAL) if the value for the
"logger.layout.class" is "org.apache.log4j.PatternLayout" this property
specifies the "ConversionPattern" to use with the Layout object
- FatalErrorWarningAppender - this is a ConsoleAppender that uses the
Standard Output Stream to display only messages that have a FATAL, ERROR,
and WARNING message Level
- logger.error.layout.class - (OPTIONAL) the fully qualified name of
the Layout object class. If not specified, the default value is
"org.apache.log4j.SimpleLayout".
- logger.error.layout.pattern - (OPTIONAL) if the value for the
"logger.layout.class" is "org.apache.log4j.PatternLayout" this property
specifies the "ConversionPattern" to use with the Layout object
- InfoDebugAppender - this is a ConsoleAppender that uses the
Standard Output Stream to display only messages that have a INFO
and DEBUG message Level
- logger.layout.class - (OPTIONAL) the fully qualified name of
the Layout object class. If not specified, the default value is
"org.apache.log4j.SimpleLayout".
- logger.layout.pattern - (OPTIONAL) if the value for the
"logger.layout.class" is "org.apache.log4j.PatternLayout" this property
specifies the "ConversionPattern" to use with the Layout object
- MultiLayoutRollingFileAppender - FileAppender that rolls over when a
maximum file size is reached. In addition, the Appender allows for multiple
Layouts to be specified for specific message levels.
- logger.layout.class - (OPTIONAL) the fully qualified name of
the Layout object class. If not specified, the default value is
"org.apache.log4j.SimpleLayout".
- logger.layout.pattern - (OPTIONAL) if the value for the
"logger.layout.class" is "org.apache.log4j.PatternLayout" this property
specifies the "ConversionPattern" to use with the Layout object
- logger.file.path - (REQUIRED) the file to which log messages are
written.
- logger.file.append - (OPTIONAL) if "true" or not specified,
messages are appended to an existing file. If "false" the destination
file is cleared before logging starts.
- logger.file.bufferedIO - (OPTIONAL) if "true" or not specified,
buffered IO is when writing to the file, which can radically improve
performance. If "false" then buffered IO is not used.
- logger.file.bufferSize - (OPTIONAL) the number of bytes in the
output buffer (used if buffered IO is enabled).
- logger.file.maxSize - (OPTIONAL) the maximum size of the file
(in bytes) before it is rolled over. If not specified, (1MB)
is used.
(See org.apache.log4j.RollingFileAppender.setMaxFileSize(String value)).
- logger.fatal.layout.class - (OPTIONAL) the fully qualified name
of the log4j Layout class to use for FATAL level messages. If not specified
the value specified in the logger.layout.class is used as the default value.
- logger.fatal.layout.pattern - (OPTIONAL) if the value of
"logger.fatal.layout.class=org.apache.log4j.PatternLayout", then this
value is set for the "ConversionPattern" for FATAL level messages. If
not specified the value specified in the logger.layout.pattern is used
as the default value.
- logger.error.layout.class - (OPTIONAL) the fully qualified name
of the log4j Layout class to use for ERROR level messages. If not specified
the value specified in the logger.layout.class is used as the default value.
- logger.error.layout.pattern - (OPTIONAL) if the value of
"logger.fatal.layout.class=org.apache.log4j.PatternLayout", then this
value is set for the "ConversionPattern" for ERROR level messages. If
not specified the value specified in the logger.layout.pattern is used
as the default value.
- logger.warning.layout.class - (OPTIONAL) the fully qualified name
of the log4j Layout class to use for WARN level messages. If not specified
the value specified in the logger.layout.class is used as the default value.
- logger.warning.layout.pattern - (OPTIONAL) if the value of
"logger.fatal.layout.class=org.apache.log4j.PatternLayout", then this
value is set for the "ConversionPattern" for WARN level messages. If
not specified the value specified in the logger.layout.pattern is used
as the default value.
- logger.info.layout.class - (OPTIONAL) the fully qualified name
of the log4j Layout class to use for INFO level messages. If not specified
the value specified in the logger.layout.class is used as the default value.
- logger.info.layout.pattern - (OPTIONAL) if the value of
"logger.fatal.layout.class=org.apache.log4j.PatternLayout", then this
value is set for the "ConversionPattern" for INFO level messages. If
not specified the value specified in the logger.layout.pattern is used
as the default value.
- logger.debug.layout.class - (OPTIONAL) the fully qualified name
of the log4j Layout class to use for DEBUG level messages. If not specified
the value specified in the logger.layout.class is used as the default value.
- logger.debug.layout.pattern - (OPTIONAL) if the value of
"logger.fatal.layout.class=org.apache.log4j.PatternLayout", then this
value is set for the "ConversionPattern" for DEBUG level messages. If
not specified the value specified in the logger.layout.pattern is used
as the default value.
- Since:
- 7/12/02
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getInstance
public static final Log4JAppenderFactory getInstance()
- Get the single instance of the Log4JAppenderFactory
- Returns:
- the single instance of the Log4JAppenderFactory
createAppender
public org.apache.log4j.Appender createAppender(Log4JAppenderType type,
Properties properties)
throws LoggerException
- Create a Log4j Appender object
This method will construct the specified type of Log4j
appender and will create it. Once created it will attempt
to initialize the appender with the various properties
supported by the Appender object. Once initialized the
method returns the Appender
- Parameters:
type - the type of Appender Object to createproperties - the initialization Properties object
- Returns:
- a created and initalized Log4j Appender object
- Throws:
LoggerException - thrown if the type is not recognized or if an error
occurs initializing an appender
Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.