You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2020/06/12 09:46:49 UTC
[logging-log4j2] branch master updated: #335 Cosmetic changes.
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new 8591745 #335 Cosmetic changes.
8591745 is described below
commit 85917452039fdeba668522c5663a54d09e058e60
Author: Volkan Yazıcı <vo...@gmail.com>
AuthorDate: Fri Jun 12 11:46:27 2020 +0200
#335 Cosmetic changes.
---
.../log4j/layout/json/template/resolver/ThreadContextDataResolver.java | 1 -
src/site/asciidoc/manual/json-template-layout.adoc | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/log4j-layout-json-template/src/main/java/org/apache/logging/log4j/layout/json/template/resolver/ThreadContextDataResolver.java b/log4j-layout-json-template/src/main/java/org/apache/logging/log4j/layout/json/template/resolver/ThreadContextDataResolver.java
index a2671fb..66efe17 100644
--- a/log4j-layout-json-template/src/main/java/org/apache/logging/log4j/layout/json/template/resolver/ThreadContextDataResolver.java
+++ b/log4j-layout-json-template/src/main/java/org/apache/logging/log4j/layout/json/template/resolver/ThreadContextDataResolver.java
@@ -169,7 +169,6 @@ final class ThreadContextDataResolver implements EventResolver {
final ReadOnlyStringMap contextData = logEvent.getContextData();
final Object value = contextData == null ? null : contextData.getValue(key);
if (stringified) {
- // TODO Write the value as string without extra allocations.
final String valueString = String.valueOf(value);
jsonWriter.writeString(valueString);
} else {
diff --git a/src/site/asciidoc/manual/json-template-layout.adoc b/src/site/asciidoc/manual/json-template-layout.adoc
index d49d8fe..db4bdcd 100644
--- a/src/site/asciidoc/manual/json-template-layout.adoc
+++ b/src/site/asciidoc/manual/json-template-layout.adoc
@@ -656,7 +656,7 @@ a|
`log4j2.garbagefreeThreadContextMap` flag needs to be turned on to iterate
the map without allocations.
-`stringify` allocates a new `String` for values that are not of type `String`.
+`stringified` allocates a new `String` for values that are not of type `String`.
Writing certain non-primitive values (e.g., `BigDecimal`, `Set`, etc.) to JSON
generates garbage, though most (e.g., `int`, `long`, `String`, `List`,