diff --git a/src/main/java/org/jboss/logmanager/ExtLogRecord.java b/src/main/java/org/jboss/logmanager/ExtLogRecord.java index 782853b..2ad1714 100644 --- a/src/main/java/org/jboss/logmanager/ExtLogRecord.java +++ b/src/main/java/org/jboss/logmanager/ExtLogRecord.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.Serializable; import java.text.MessageFormat; import java.util.Map; import java.util.MissingResourceException; @@ -118,6 +119,7 @@ public ExtLogRecord(final ExtLogRecord original) { hostName = original.hostName; processName = original.processName; processId = original.processId; + marker = original.marker; } /** @@ -141,7 +143,7 @@ public static ExtLogRecord wrap(LogRecord rec) { private transient boolean calculateCaller = true; private String ndc; - private FormatStyle formatStyle = FormatStyle.MESSAGE_FORMAT; + private FormatStyle formatStyle; private FastCopyHashMap mdcCopy; private int sourceLineNumber = -1; private String sourceFileName; @@ -151,6 +153,7 @@ public static ExtLogRecord wrap(LogRecord rec) { private long processId = -1; private String sourceModuleName; private String sourceModuleVersion; + private Object marker; private void writeObject(ObjectOutputStream oos) throws IOException { copyAll(); @@ -171,6 +174,7 @@ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound processId = fields.get("processId", -1L); sourceModuleName = (String) fields.get("sourceModuleName", null); sourceModuleVersion = (String) fields.get("sourceModuleVersion", null); + marker = fields.get("marker", null); } /** @@ -615,4 +619,15 @@ public void setResourceBundle(final ResourceBundle bundle) { public void setResourceBundleName(final String name) { super.setResourceBundleName(name); } + + /** + * Set the marker for this event. Markers are used mostly by SLF4J and Log4j. + */ + public void setMarker(Object marker) { + this.marker = marker; + } + + public Object getMarker() { + return marker; + } }