You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/site/antora/modules/ROOT/pages/manual/api.adoc
+22-8
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,7 @@ xref:manual/logbuilder.adoc[Read more on the Fluent API...]
239
239
[#fish-tagging]
240
240
== Fish tagging
241
241
242
-
Just as a fish can be tagged and have its movement tracked (aka. _fish tagging_), stamping log events with a common tag or set of data
242
+
Just as a fish can be tagged and have its movement tracked (aka. _fish tagging_ footnote:[Fish tagging is first described by Neil Harrison in the _"Patterns for Logging Diagnostic Messages"_ chapter of https://dl.acm.org/doi/10.5555/273448[_"Pattern Languages of Program Design 3"_ edited by R. Martin, D. Riehle, and F. Buschmann in 1997].]), stamping log events with a common tag or set of data
243
243
elements allows the complete flow of a transaction or a request to be tracked.
244
244
You can use them for several purposes, such as:
245
245
@@ -283,7 +283,7 @@ xref:manual/markers.adoc[Read more on markers...]
283
283
[#scoped-context]
284
284
=== Scoped Context
285
285
286
-
Just like a https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/ScopedValue.html[Java's `ScopedValue`], in Scoped Context, the visibility of tags are associated with the block they were introduced:
286
+
Just like a https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/ScopedValue.html[Java's `ScopedValue`], _Scoped Context_ facilitates associating information with a certain block of code and makings this accessible to the rest of the logging system:
287
287
288
288
[source,java]
289
289
----
@@ -317,22 +317,36 @@ xref:manual/scoped-context.adoc[Read more on Scoped Context...]
317
317
[#thread-context]
318
318
=== Thread Context
319
319
320
-
Just like https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html[Java's `ThreadLocal`], in Thread Context, the visibility of tags are associated with the thread they were introduced.
321
-
Thread Context offers both a map-structured, called _Mapped Diagnostic Context (MDC)_, and a stack-structured, called _Nested Diagnostic Context (NDC)_, storage:
320
+
Just like https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html[Java's `ThreadLocal`], _Thread Context_ facilitates associating information with the executing thread and making this information accessible to the rest of the logging system.
321
+
Thread Context offers both
322
+
323
+
* map-structured – referred to as _Thread Context Map_ or _Mapped Diagnostic Context (MDC)_
324
+
* stack-structured – referred to as _Thread Context Stack_ or _Nested Diagnostic Context (NDC)_
Copy file name to clipboardExpand all lines: src/site/antora/modules/ROOT/pages/manual/garbagefree.adoc
+2-1
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,8 @@ The `Unbox.box(primitive)` methods write directly into a `StringBuilder`, and th
209
209
Not all Log4j API feature set is garbage-free, specifically:
210
210
211
211
* The `ThreadContext` map (aka. MDC) is not garbage-free by default, but can be configured to be garbage-free by setting xref:#log4j2.garbagefreeThreadContextMap[the `log4j2.garbagefreeThreadContextMap` system property] to `true`.
212
-
* The `ThreadContext` stack is not garbage-free.
212
+
* The `ThreadContext` stack (aka. NDC) is not garbage-free.
213
+
* xref:manual/scoped-context.adoc[] is not garbage-free.
213
214
* Logging very large messages (i.e., more than xref:#log4j2.maxReusableMsgSize[`log4j2.maxReusableMsgSize`] characters, which defaults to 518), when all loggers are xref:manual/async.adoc[asynchronous loggers], will cause the internal `StringBuilder` in the
214
215
`RingBuffer` to be trimmed back to their configured maximum size.
0 commit comments