Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding marker property to ExLogRecord #3

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/main/java/org/jboss/logmanager/ExtLogRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -118,6 +119,7 @@ public ExtLogRecord(final ExtLogRecord original) {
hostName = original.hostName;
processName = original.processName;
processId = original.processId;
marker = original.marker;
}

/**
Expand All @@ -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<String, Object> mdcCopy;
private int sourceLineNumber = -1;
private String sourceFileName;
Expand All @@ -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();
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}
}