Class ErrorLogEvent
- java.lang.Object
-
- de.businesscode.bcdui.logging.LogEventBase
-
- de.businesscode.bcdui.web.errorLogging.ErrorLogEvent
-
- All Implemented Interfaces:
java.io.Serializable
,org.apache.logging.log4j.message.Message
public class ErrorLogEvent extends LogEventBase
The error-logEvent for usage with the ErrorLogAppender.
All thrownServletException
are processed inRequestLifeCycleFilter
and logged properly, so there is usually no reason to manually use this class.
Example: ... private final Logger virtLoggerError = LogManager.getLogger("de.businesscode.bcdui.logging.virtlogger.error"); ... virtLoggerError.info(new ErrorLogEvent("Error", request), exception); ...- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request)
ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request, java.lang.String data)
ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request, java.lang.String data, java.lang.Throwable thrwbl)
ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request, java.lang.Throwable thrwbl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFormattedMessage()
java.lang.String
getMessage()
java.lang.String
getRefererUrl()
java.lang.String
getRemoteAddr()
javax.servlet.http.HttpServletRequest
getRequest()
java.lang.Integer
getRequestHash()
java.lang.String
getRequestUrl()
java.lang.Throwable
getThrowable()
java.lang.String
getUserAgent()
java.lang.String
getUserName()
java.lang.String
toString()
-
Methods inherited from class de.businesscode.bcdui.logging.LogEventBase
getFormat, getParameters
-
-
-
-
Constructor Detail
-
ErrorLogEvent
public ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request, java.lang.String data, java.lang.Throwable thrwbl)
- Parameters:
message
-request
-data
-thrwbl
-
-
ErrorLogEvent
public ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request, java.lang.String data)
- Parameters:
message
-request
-data
-
-
ErrorLogEvent
public ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request, java.lang.Throwable thrwbl)
- Parameters:
message
-request
-thrwbl
-
-
ErrorLogEvent
public ErrorLogEvent(java.lang.String message, javax.servlet.http.HttpServletRequest request)
- Parameters:
message
-request
-
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
- Returns:
- the message
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Returns:
- the request
-
getUserName
public java.lang.String getUserName()
- Returns:
- the username from request
-
getRequestUrl
public java.lang.String getRequestUrl()
- Returns:
- the requestUrl from request
-
getRefererUrl
public java.lang.String getRefererUrl()
- Returns:
- the refererUrl from request
-
getRemoteAddr
public java.lang.String getRemoteAddr()
- Returns:
- the remoteAddr from request
-
getUserAgent
public java.lang.String getUserAgent()
- Returns:
- the userAgent from request
-
getRequestHash
public java.lang.Integer getRequestHash()
- Returns:
- the requestHash from request
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFormattedMessage
public java.lang.String getFormattedMessage()
-
getThrowable
public java.lang.Throwable getThrowable()
- Specified by:
getThrowable
in interfaceorg.apache.logging.log4j.message.Message
- Overrides:
getThrowable
in classLogEventBase
-
-