Class FrozenLogEvent
java.lang.Object
org.jpos.util.LogEvent
org.jpos.util.FrozenLogEvent
- All Implemented Interfaces:
Serializable
An immutable, serializable snapshot of a
LogEvent.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFrozenLogEvent(String frozen) Creates a FrozenLogEvent from a pre-rendered string.FrozenLogEvent(LogEvent evt) Creates a FrozenLogEvent by capturing the current dump of the given LogEvent. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream ps, String indent) Dumps the full log event to the given PrintStream.toString()Renders this event to a string with no leading indent.Methods inherited from class LogEvent
add, addMessage, addMessage, dumpHeader, dumpTrailer, getCreatedAt, getDumpedAt, getPayLoad, getRealm, getSource, getTag, getTags, getTraceId, hasException, isHonorSourceLogger, setNoArmor, setSource, setTag, toString, withSource, withTag, withTags, withTraceId, withTraceId, withTraceIdModifier and TypeMethodDescriptionAppends a payload entry and returns this event for chaining.voidaddMessage(Object msg) Adds a message or object to this event's payload.voidaddMessage(String tagname, String message) Adds a message wrapped in an XML tag to this event's payload.protected StringdumpHeader(PrintStream p, String indent) Writes the log event header to the given PrintStream.protected voiddumpTrailer(PrintStream p, String indent) Writes the log event trailer to the given PrintStream.Returns the time at which this event was constructed.Returns the time at which this event was first dumped, capturing it on first call.WARNING: payLoad is a SynchronizedList.getRealm()Returns the realm of the associated source, or empty when no source is set.Returns theLogSourceassociated with this event, if any.getTag()Returns the log tag.getTags()Returns an unmodifiable view of this event's tags.Returns the current trace-id, generating one if absent.booleanIndicates whether the payload contains aThrowable.booleanThis is a hack for backward compatibility after accepting PR67voidsetNoArmor(boolean noArmor) Controls whether the XML wrapper is suppressed in log output.voidReplaces theLogSourceassociated with this event.voidSets the log tag for this event.Renders this event to a string with the given indent prefix.withSource(LogSource source) Sets theLogSourceassociated with this event and returns it for chaining.Adds or overwrites a tag on this event.Adds the supplied tags to this event.Ensures atrace-idtag is present, generating one if needed.withTraceId(String traceId) Sets thetrace-idtag explicitly.withTraceId(UUID uuid) Sets thetrace-idtag from a UUID (dashes stripped).
-
Constructor Details
-
FrozenLogEvent
Creates a FrozenLogEvent from a pre-rendered string.- Parameters:
frozen- the pre-rendered log event string
-
FrozenLogEvent
Creates a FrozenLogEvent by capturing the current dump of the given LogEvent.- Parameters:
evt- the LogEvent to freeze
-
-
Method Details
-
dump
-
toString
-