Class 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 thrown ServletException are processed in RequestLifeCycleFilter 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)  
    • 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 class java.lang.Object
      • getFormattedMessage

        public java.lang.String getFormattedMessage()
      • getThrowable

        public java.lang.Throwable getThrowable()
        Specified by:
        getThrowable in interface org.apache.logging.log4j.message.Message
        Overrides:
        getThrowable in class LogEventBase