Package org.xwiki.logging.event
Class LogEvent
- java.lang.Object
-
- org.xwiki.logging.Message
-
- org.xwiki.logging.event.LogEvent
-
- All Implemented Interfaces:
Serializable
,CharSequence
,Event
- Direct Known Subclasses:
BeginLogEvent
,EndLogEvent
public class LogEvent extends Message implements Event
Sent when logger is called.The event also send the following parameters:
- source: the name of the associated logger
- data: null
- Since:
- 3.2M1
- Version:
- $Id: de58ee4a0a22b33fd1e0f9ae588d043a739163bb $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Marker
MARKER_BEGIN
The marker to use to indicate that we start a group of logs.static org.slf4j.Marker
MARKER_END
The marker to use to indicate that we stop a group of logs.
-
Constructor Summary
Constructors Constructor Description LogEvent()
Matches anyLogEvent
.LogEvent(org.slf4j.Marker marker, LogLevel level, String message, Object[] argumentArray, Throwable throwable)
LogEvent(org.slf4j.Marker marker, LogLevel level, String message, Object[] argumentArray, Throwable throwable, long timeStamp)
LogEvent(LogEvent logEvent)
LogEvent(LogLevel level, String message, Object[] argumentArray, Throwable throwable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
LogLevel
getLevel()
long
getTimeStamp()
int
hashCode()
void
log(org.slf4j.Logger targetLogger)
Copy the stored log into a passedLogger
.boolean
matches(Object otherEvent)
String
toString()
-
Methods inherited from class org.xwiki.logging.Message
charAt, equals, getArgumentArray, getFormattedMessage, getMarker, getMessage, getMessageElements, getThrowable, getTranslationKey, length, subSequence
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
LogEvent
public LogEvent()
Matches anyLogEvent
.
-
LogEvent
public LogEvent(LogEvent logEvent)
- Parameters:
logEvent
- the log event to copy- Since:
- 5.4M1
-
LogEvent
public LogEvent(LogLevel level, String message, Object[] argumentArray, Throwable throwable)
- Parameters:
level
- the log levelmessage
- the log messageargumentArray
- the event arguments to insert in the messagethrowable
- the throwable associated to the event
-
LogEvent
public LogEvent(org.slf4j.Marker marker, LogLevel level, String message, Object[] argumentArray, Throwable throwable)
- Parameters:
marker
- the log markerlevel
- the log levelmessage
- the log messageargumentArray
- the event arguments to insert in the messagethrowable
- the throwable associated to the event- Since:
- 4.3M
-
LogEvent
public LogEvent(org.slf4j.Marker marker, LogLevel level, String message, Object[] argumentArray, Throwable throwable, long timeStamp)
- Parameters:
marker
- the log markerlevel
- the log levelmessage
- the log messageargumentArray
- the event arguments to insert in the messagethrowable
- the throwable associated to the eventtimeStamp
- the number of milliseconds elapsed from 1/1/1970 until logging event was created.- Since:
- 6.4M1
-
-
Method Detail
-
log
public void log(org.slf4j.Logger targetLogger)
Copy the stored log into a passedLogger
.- Parameters:
targetLogger
- the logger where to copy the stored log- Since:
- 5.3M1
-
getLevel
public LogLevel getLevel()
- Returns:
- the log level
-
getTimeStamp
public long getTimeStamp()
- Returns:
- the number of milliseconds elapsed from 1/1/1970 until logging event was created
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classMessage
-
-