|
andyLib v0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.andynaz.log.Logger
it.andynaz.log.FileLogger
public class FileLogger
File Logger. Writes the logs on a text file.
Each constructor calls the corresponding constructor of the Logger
class, so the FileLogger object inherits all the properties the Logger class
has (and uses all of its options).
Field Summary | |
---|---|
protected File |
logFile
File in which write the logs. |
Fields inherited from class it.andynaz.log.Logger |
---|
dateFormat, level, name, separator, useDate, useLevel |
Constructor Summary | |
---|---|
FileLogger()
Creates a FileLogger. |
|
FileLogger(Config conf)
Deprecated. Use FileLogger(Properties) instead; this method will
be removed in future release. |
|
FileLogger(Properties props)
Creates a FileLogger with a configuration. |
|
FileLogger(String name)
Creates a FileLogger with a name. |
|
FileLogger(String name,
Config conf)
Deprecated. Use FileLogger(String, Properties) instead; this
method will be removed in future release. |
|
FileLogger(String name,
Properties props)
Creates a FileLogger with a name and a configuration. |
Method Summary | |
---|---|
void |
log(Exception e,
Level level)
Writes the log of an exception with a specificied level. |
void |
log(String log,
Level level)
Writes the log. |
Methods inherited from class it.andynaz.log.Logger |
---|
getDate, getPrefix, getPrefix, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected File logFile
Constructor Detail |
---|
@Deprecated public FileLogger(String name, Config conf)
FileLogger(String, Properties)
instead; this
method will be removed in future release.
The path of the file in which write the logs is taken from the property "fileLogger.file".
name
- name of the Loggerconf
- configuration of the Loggerpublic FileLogger(String name, Properties props)
The path of the log file is taken from the property "log.fileLogger.file
". Note that the param name is a little different from
the one used in the FileLogger(String, Config)
method.
name
- name of the Loggerprops
- configuration of the Loggerfor all the other properties see
the Logger constructor
public FileLogger(String name)
ConfigMgr.getConfigParams()
method).
name
- name of the LoggerFileLogger(String, Properties)
@Deprecated public FileLogger(Config conf)
FileLogger(Properties)
instead; this method will
be removed in future release.
conf
- configuration of the Loggerpublic FileLogger(Properties props)
props
- configuration of the LoggerFileLogger(String, Properties)
public FileLogger()
FileLogger(String, Properties)
Method Detail |
---|
public void log(String log, Level level)
Logger.log(String, Level)
method.
log
in class Logger
log
- log to be writtenlevel
- log levelpublic void log(Exception e, Level level)
If it is not possible, invokes the Logger.log(Exception, Level)
method.
log
in class Logger
e
- exception to be loggedlevel
- log level
|
andyLib v0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |