|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.io.IOException
org.norther.tammi.core.base.LogException
public class LogException
A generic exception supporting consistent run-time error management and
configurable logging of run-time exceptions. Every exception to be logged by
the server should be thrown as a LogException. An exception
to be reported to the user should be thrown as a UserException.
Dynamic data can be added to messages as arguments. The first argument is always the date and time of the exception, and the last one the class name and message of an optional cause throwable. Other arguments can be given as parameters to the constructors of the exception. The following parameters are supported:
ObjectThe exception maintains a log of thrown exceptions. The properties of the log can be configured separately (not available yet). The static log method can be used to log messages without throwing exceptions.
| Field Summary | |
|---|---|
static int |
DEFAULT
The default logging level of the exception. |
static int |
ERROR
The recoverable error level. |
static int |
FATAL
The fatal error level. |
static int |
INFO
The info level. |
static int |
NONE
The none level. |
static int |
WARN
The warn level. |
static int |
WARNING
The warning level. |
| Constructor Summary | |
|---|---|
LogException(int level,
String message)
Constructs an exception at the specified severity level with a message. |
|
LogException(int level,
String message,
Object argument)
Constructs an exception at the specified severity level with a message and argument. |
|
LogException(int level,
String message,
Object argument,
Throwable cause)
Constructs an exception at the specified severity level with a message, argument and cause. |
|
LogException(int level,
String message,
Throwable cause)
Constructs an exception at the specified severity level with a message and cause. |
|
LogException(int level,
Throwable cause)
Constructs an exception at the specified severity level with a cause. |
|
LogException(String message)
Constructs an exception with a message. |
|
LogException(String message,
Object argument)
Constructs an exception with a message and argument. |
|
LogException(String message,
Object argument,
Throwable cause)
Constructs an exception with a message, argument and cause. |
|
LogException(String message,
Throwable cause)
Constructs an exception with a message and cause. |
|
LogException(Throwable cause)
Constructs an exception with a cause. |
|
| Method Summary | |
|---|---|
Object |
getArgument()
Gets the argument in the exception. |
int |
getLevel()
Gets the level of the exception. |
String |
getLocalizedMessage()
|
String |
getLocalizedMessage(Locale locale)
Gets a localized message for the specified locale. |
String |
getLocalizedMessage(Localizer localizer,
Locale locale)
Gets a localized message for the specified locale applying the given localizer. |
protected Log |
getMessageLog()
Gets the message log. |
long |
getTime()
Gets the time of the exception. |
protected void |
setLevel(int level)
Sets the level of the exception. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int INFO
public static final int WARN
public static final int WARNING
public static final int ERROR
public static final int FATAL
public static final int DEFAULT
| Constructor Detail |
|---|
public LogException(String message)
message - a message.public LogException(Throwable cause)
cause - a cause throwable.
public LogException(String message,
Throwable cause)
message - a message.cause - a cause throwable.
public LogException(String message,
Object argument)
message - a message.argument - an argument.
public LogException(String message,
Object argument,
Throwable cause)
message - a message.argument - an argument.cause - a cause throwable.
public LogException(int level,
String message)
level - the level.message - a message.
public LogException(int level,
Throwable cause)
level - the level.cause - a cause throwable.
public LogException(int level,
String message,
Throwable cause)
level - the level.message - a message.cause - a cause throwable.
public LogException(int level,
String message,
Object argument)
level - the level.message - a message.argument - an argument.
public LogException(int level,
String message,
Object argument,
Throwable cause)
level - the level.message - a message.argument - an argument.cause - a cause throwable.| Method Detail |
|---|
public String getLocalizedMessage()
getLocalizedMessage in class Throwablepublic String getLocalizedMessage(Locale locale)
locale - the locale of the message.
public String getLocalizedMessage(Localizer localizer,
Locale locale)
localizer - the localizer to apply.locale - the locale of the message.
public long getTime()
public int getLevel()
public Object getArgument()
protected void setLevel(int level)
level - the level.protected Log getMessageLog()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||