com.groiss.log
Interface ILogger

All Superinterfaces:
Lifecycle, Service
All Known Implementing Classes:
Logger

public interface ILogger
extends Service

An interface for logging messages.


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()
          The file where messages are logged.
 java.io.PrintWriter getWriter()
          Return the Writer to write some stuff to the log file.
 void log(java.lang.String str, int level)
          This method writes the given string into the logfile.
 void logError(java.lang.Throwable err)
          Prints a header line and a stack trace for the given Error or Exception
 void logError(java.lang.Throwable err, 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 restart()
          Restart the Logger (reinitialize log file)
 
Methods inherited from interface com.groiss.component.Service
isRunning, reconfigure
 
Methods inherited from interface com.groiss.component.Lifecycle
shutdown, startup
 

Method Detail

log

void log(java.lang.String str,
         int level)
This method writes the given string into the logfile. depending on the log level

Parameters:
str - string to put into the logfile
level - the log level, an integer between 0 and 4

logError

void logError(java.lang.Throwable err)
Prints a header line and a stack trace for the given Error or Exception


getExceptionCount

long getExceptionCount()
Return the number of exceptions since startup

Returns:
a long value

getLastExceptionDate

java.util.Date getLastExceptionDate()
Return the date when the last exception has occured

Returns:
a date value

logError

void logError(java.lang.Throwable err,
              java.lang.String errHeader)
Prints a header line and a stack trace for the given Error or Exception

Parameters:
err - a Throwable objecat
errHeader - the text for the header line

logError

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

Parameters:
error - a Throwable object
errHeader - the text for the header line
level - an integer between 0 and 4. The exception is logged if greater or equal the log level,

getLogFile

java.io.File getLogFile()
The file where messages are logged.

Returns:
the log file

getErrorLogFile

java.io.File getErrorLogFile()
The file where errors are logged, if errors are logged to a separate file.

Returns:
the error file

getWriter

java.io.PrintWriter getWriter()
Return the Writer to write some stuff to the log file. Do not close this writer, it is used for logging.


getLevel

int getLevel()
Returns the log level.


restart

void restart()
Restart the Logger (reinitialize log file)



@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.