Skip to content

Class JoggerError

hxs edited this page Dec 1, 2019 · 7 revisions

JoggerError

Extends Jogger

Package jogger
File JoggerError.java

JoggerError is the class to log the exception of an appllication. This class is an extension of Jogger class.

For other methods check the class parent Jogger.


Constructs

JoggerError()

This is a simple construct.

Example:

JoggerError j = new JoggerError();

JoggerError(String logName)

This construct set the log name.

Parameters:

  • logName, name for log file

Example:

JoggerError j = new JoggerError("log_name");

JoggerError(String logName, Integer maxSizeBytes)

This construct set the log name and the max size of log file.

Parameters:

  • logName, name for log file
  • maxSizeBytes, maximum size of log file, in bytes

Example:

JoggerError j = new JoggerError("log_name", 1024000);

Methods

Log

void writeLog(Exception exception)

throws LockLogException

This method print, on error log, the exception passed. Implement Jogger-Lock. For more info Jogger-Lock.

Exceptions:

  • LockLogException, exception thrown if the timeout for the lock expires

Example:

JoggerError joggerError = new JoggerError();
try {
  // your code who can
  // raise an exception
} catch (Exception e) {
  joggerError.writeLog(e);
}

void writeLog(String write)

Override void writeLog(String write) of Jogger

This method is deprecated and not working. Use void writeLog(Exception exception).