|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.apache.turbine.services.logging.BaseLogger
This is an abbstract class that implements Logger interface. User implementation has to redefine only five methods that can handle different type of destinations.
| Field Summary | |
protected boolean |
console
flag is set when console writing is allowed |
protected boolean |
initialize
Store status of the logger |
protected LoggingConfig |
loggingConfig
The LoggingConfig object for this logger |
protected int |
logLevel
Current log level for logger |
protected java.lang.String |
name
Name of the logger |
protected RunDataFilter |
runDataFilter
Extracts data from RunData |
| Fields inherited from interface org.apache.turbine.services.logging.Logger |
BACKUP_KEY, CONSOLE_KEY, DB_KEY, DB_LOGGER_KEY, DB_POOL_KEY, DEBUG, EMAIL_KEY, EMAILBUFFERSIZE_KEY, EMAILFROM_KEY, EMAILSUBJECT_KEY, EMAILTO_KEY, ERROR, FACILITY_KEY, FILE_KEY, FORMAT_KEY, HOST_KEY, INFO, LEVELDEBUG, LEVELERROR, LEVELINFO, LEVELWARN, PATH_KEY, PORT_KEY, REMOTE_KEY, SIZE_KEY, SYSLOGD_KEY, WARN |
| Constructor Summary | |
BaseLogger()
Default Constructor |
|
| Method Summary | |
abstract boolean |
checkLogger()
This method should be implemented by user. |
protected void |
configureConsole(LoggingConfig loggingConfig)
This method should be implemented by user if the logger can handle remote server. |
protected void |
configureDatabase(LoggingConfig loggingConfig)
This method should be implemented by user if the logger can handle database logs. |
protected void |
configureEmail(LoggingConfig loggingConfig)
This method should be implemented by user if the logger can handle emailing logs. |
protected void |
configureFiles(LoggingConfig loggingConfig)
This method should be implemented by user if the logger can handle files. |
protected void |
configureRemote(LoggingConfig loggingConfig)
This method should be implemented by user if the logger can handle console. |
protected void |
configureSyslog(LoggingConfig loggingConfig)
This method should be implemented by user if the logger can handle syslog demon. |
protected void |
doDispatch(LoggingConfig loggingConfig)
Dispatches tasks for different types of destinations. |
java.lang.String |
getName()
Returns logger's name |
void |
init(LoggingConfig loggingConfig)
This method should be reimplemented by user if class use need some objects intialization. |
boolean |
isDebugEnabled()
Checks if DEBUG statements are enabled. |
boolean |
isErrorEnabled()
Checks if ERROR statements are enabled. |
boolean |
isInfoEnabled()
Checks if INFO statements are enabled. |
boolean |
isWarnEnabled()
Checks if WARN statements are enabled. |
void |
setFormat(java.lang.String format)
Sets format output of the Rundata. |
void |
setLogLevel(int level)
Sets the logging level based on the numeric level passed in. |
protected void |
setLogLevel(java.lang.String level)
Sets the logging level based on the text passed in. |
void |
setName(java.lang.String logName)
Sets the name of the logger |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.turbine.services.logging.Logger |
debug, debug, debug, debug, error, error, error, error, error, info, info, info, info, shutdown, warn, warn, warn, warn |
| Field Detail |
protected int logLevel
protected java.lang.String name
protected boolean initialize
protected RunDataFilter runDataFilter
protected LoggingConfig loggingConfig
protected boolean console
| Constructor Detail |
public BaseLogger()
| Method Detail |
public void init(LoggingConfig loggingConfig)
init in interface LoggerloggingConfig - Configuration describing the logger.protected void doDispatch(LoggingConfig loggingConfig)
loggingConfig - Configuration describing the logger.public java.lang.String getName()
getName in interface Loggerpublic void setName(java.lang.String logName)
setName in interface Loggerpublic void setFormat(java.lang.String format)
Rundata.
Format style is defined in the BaseRunDataFilter class.
setFormat in interface Loggerformat - Text describing which data should be extracted from
RunDataBaseRunDataFilterprotected void setLogLevel(java.lang.String level)
setLogLevel(int).
level - The logging level represented as text.public void setLogLevel(int level)
setLogLevel in interface Loggerlevel - The logging level.public boolean isDebugEnabled()
isDebugEnabled in interface Loggerpublic boolean isInfoEnabled()
isInfoEnabled in interface Loggerpublic boolean isWarnEnabled()
isWarnEnabled in interface Loggerpublic boolean isErrorEnabled()
isErrorEnabled in interface Loggerprotected void configureFiles(LoggingConfig loggingConfig)
protected void configureConsole(LoggingConfig loggingConfig)
loggingConfig - Configuration describing the logger.protected void configureRemote(LoggingConfig loggingConfig)
loggingConfig - Configuration describing the logger.protected void configureSyslog(LoggingConfig loggingConfig)
loggingConfig - Configuration describing the logger.protected void configureEmail(LoggingConfig loggingConfig)
loggingConfig - Configuration describing the logger.protected void configureDatabase(LoggingConfig loggingConfig)
loggingConfig - Configuration describing the logger.public abstract boolean checkLogger()
checkLogger in interface Logger
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||