You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2020/04/20 01:05:05 UTC

[logging-log4j2] branch release-2.x updated: LOG4J2-2588 - Mark timeMillis as read only

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 3c33661  LOG4J2-2588 - Mark timeMillis as read only
3c33661 is described below

commit 3c3366180577d18841538bd4fce6243e499ed994
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sun Apr 19 18:04:52 2020 -0700

    LOG4J2-2588 - Mark timeMillis as read only
---
 .../java/org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java   | 2 +-
 .../apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java
index f95b6ef..0c53c41 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java
@@ -127,7 +127,7 @@ abstract class LogEventJsonMixIn implements LogEvent {
     @Override
     public abstract ThrowableProxy getThrownProxy();
 
-    @JsonProperty(JsonConstants.ELT_TIME_MILLIS)
+    @JsonProperty(value = JsonConstants.ELT_TIME_MILLIS, access = JsonProperty.Access.READ_ONLY)
     @JacksonXmlProperty(isAttribute = true)
     @Override
     public abstract long getTimeMillis();
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java
index b4f7b76..36098a8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java
@@ -126,7 +126,7 @@ abstract class LogEventWithContextListMixIn implements LogEvent {
     @Override
     public abstract ThrowableProxy getThrownProxy();
 
-    @JsonProperty(JsonConstants.ELT_TIME_MILLIS)
+    @JsonProperty(value = JsonConstants.ELT_TIME_MILLIS, access = JsonProperty.Access.READ_ONLY)
     @JacksonXmlProperty(isAttribute = true)
     @Override
     public abstract long getTimeMillis();