|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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. |
private void |
doBaseInit(LoggingConfig loggingConfig)
Starts configuration of the logger, sets name, format, loging level (defaults to DEBUG ). |
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. |
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 |
|
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 Logger
loggingConfig
- Configuration describing the logger.private void doBaseInit(LoggingConfig loggingConfig)
DEBUG
).loggingConfig
- Configuration describing the logger.protected void doDispatch(LoggingConfig loggingConfig)
loggingConfig
- Configuration describing the logger.public java.lang.String getName()
getName
in interface Logger
public void setName(java.lang.String logName)
setName
in interface Logger
public void setFormat(java.lang.String format)
Rundata
.
Format style is defined in the BaseRunDataFilter class.setFormat
in interface Logger
format
- Text describing which data should be extracted from
RunDataBaseRunDataFilter
protected void setLogLevel(java.lang.String level)
setLogLevel(int)
.level
- The logging level represented as text.public void setLogLevel(int level)
setLogLevel
in interface Logger
level
- The logging level.protected void configureFiles(LoggingConfig loggingConfig)
LoggingConfig
- configurationprotected 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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |