|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.log.Logger
public class Logger
Default implementation of the ILogger interface.
| Field Summary | |
|---|---|
protected static java.io.PrintWriter |
err
|
protected static java.util.Date |
errdate
|
protected static java.io.File |
errfile
|
protected static long |
errs
|
protected static java.lang.String |
linesep
|
protected static java.io.PrintWriter |
log
|
protected static java.io.File |
logfile
|
protected static int |
trace
|
| Constructor Summary | |
|---|---|
Logger()
|
|
Logger(java.io.PrintWriter logger,
int traceLevel)
|
|
| Method Summary | |
|---|---|
java.io.File |
getErrorLogFile()
The file where errors are logged, if errors are logged to a separate file. |
long |
getExceptionCount()
Return the number of exceptions since startup |
java.util.Date |
getLastExceptionDate()
Return the date when the last exception has occured |
int |
getLevel()
Returns the log level. |
java.io.File |
getLogFile()
Return the Reader to read the current log file. |
protected java.lang.String |
getLogPrefix(int level)
Returns the prefix of a log entry (which is the part before the specific log message). |
java.io.PrintWriter |
getWriter()
Return the Writer to write some stuff to the log file. |
boolean |
isRunning()
|
void |
log(java.lang.String str)
This method writes the given string into the logfile. |
void |
log(java.lang.String str,
int level)
This method writes the given string into the logfile. |
void |
logError(java.lang.Throwable e)
Prints a header line and a stack trace for the given Error or Exception |
void |
logError(java.lang.Throwable error,
java.lang.String errHeader)
Prints a header line and a stack trace for the given Error or Exception |
void |
logError(java.lang.Throwable error,
java.lang.String errHeader,
int level)
Prints a header line and a stack trace for the given Error or Exception |
void |
reconfigure()
|
void |
restart()
Restart the Logger (reinitialize log file) |
void |
shutdown()
|
void |
startup()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.io.PrintWriter log
protected static java.io.PrintWriter err
protected static java.io.File logfile
protected static java.io.File errfile
protected static int trace
protected static long errs
protected static java.util.Date errdate
protected static java.lang.String linesep
| Constructor Detail |
|---|
public Logger()
public Logger(java.io.PrintWriter logger,
int traceLevel)
| Method Detail |
|---|
public void shutdown()
throws ApplicationException
shutdown in interface ServiceApplicationException
public boolean isRunning()
throws ApplicationException
isRunning in interface ServiceApplicationException
public void reconfigure()
throws ApplicationException
reconfigure in interface ServiceApplicationException
public void startup()
throws ApplicationException
startup in interface ServiceApplicationExceptionpublic void log(java.lang.String str)
str - string to put into the logfile
public void log(java.lang.String str,
int level)
log in interface ILoggerstr - string to put into the logfilelevel - the log level, an integer between 0 and 4public void logError(java.lang.Throwable e)
logError in interface ILogger
public void logError(java.lang.Throwable error,
java.lang.String errHeader)
logError in interface ILoggererror - a Throwable objecterrHeader - the text for the header line
public void logError(java.lang.Throwable error,
java.lang.String errHeader,
int level)
logError in interface ILoggererror - a Throwable objecterrHeader - the text for the header linelevel - an integer between 0 and 4. The exception is logged if greater or equal the log level,public long getExceptionCount()
ILogger
getExceptionCount in interface ILoggerpublic java.util.Date getLastExceptionDate()
ILogger
getLastExceptionDate in interface ILogger
public java.io.File getLogFile()
throws ApplicationException
getLogFile in interface ILoggerApplicationException
public java.io.File getErrorLogFile()
throws ApplicationException
ILogger
getErrorLogFile in interface ILoggerApplicationExceptionpublic java.io.PrintWriter getWriter()
getWriter in interface ILoggerpublic int getLevel()
getLevel in interface ILogger
public void restart()
throws ApplicationException
ILogger
restart in interface ILoggerApplicationExceptionprotected java.lang.String getLogPrefix(int level)
level -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||