|
14 | 14 | See the License for the specific language governing permissions and |
15 | 15 | limitations under the License. |
16 | 16 | //// |
| 17 | +// tag::clock[] |
17 | 18 | [id=log4j2.clock] |
18 | 19 | == `log4j2.clock` |
19 | 20 |
|
|
24 | 25 | | Default value | ``SystemClock`` |
25 | 26 | |=== |
26 | 27 |
|
27 | | -Specifies the |
| 28 | +It specifies the |
28 | 29 | link:../javadoc/log4j-core/org/apache/logging/log4j/core/util/Clock.html[`Clock`] |
29 | 30 | implementation used to timestamp log events. |
30 | 31 |
|
31 | 32 | This must be the fully qualified class name of the implementation or one of these predefined constants: |
32 | 33 |
|
33 | | -SystemClock:: uses the best available system clock as time source. |
| 34 | +SystemClock:: It uses the best available system time source. |
34 | 35 | See https://docs.oracle.com/javase/{java-target-version}/docs/api/java/time/Clock.html#systemDefaultZone--[`Clock#systemDefaultZone()`] for details. |
| 36 | ++ |
| 37 | +[NOTE] |
| 38 | +==== |
| 39 | +Depending on the version of the JRE, this implementation might not be garbage-free or might only become garbage-free when the code is hot enough. |
| 40 | +
|
| 41 | +If you don't require a nanosecond precision, and you need a garbage-free implementation, use <<log4j2.clock.SystemMillisClock,`SystemMillisClock`>>. |
| 42 | +==== |
35 | 43 |
|
36 | | -SystemMillisClock:: same as `SystemClock`, but truncates the result to a millisecond. |
| 44 | +[id=log4j2.clock.SystemMillisClock] |
| 45 | +SystemMillisClock:: It is similar to `SystemClock`, but truncates the result to a millisecond. |
| 46 | +This implementation is garbage-free. |
37 | 47 |
|
38 | | -CachedClock:: uses a separate thread to update the timestamp value. |
| 48 | +CachedClock:: It uses a separate thread to update the timestamp value. |
39 | 49 | See |
40 | 50 | link:../javadoc/log4j-core/org/apache/logging/log4j/core/util/CachedClock.html[`CachedClock`] |
41 | 51 | for details. |
42 | 52 |
|
43 | | -CoarseCachedClock:: alternative implementation of `CachedClock` with a slightly lower precision. |
| 53 | +CoarseCachedClock:: This is an alternative implementation of `CachedClock` with a slightly lower precision. |
44 | 54 | See |
45 | 55 | link:../javadoc/log4j-core/org/apache/logging/log4j/core/util/CoarseCachedClock.html[`CoarseCachedClock`] |
46 | 56 | for details. |
| 57 | +// end::clock[] |
47 | 58 |
|
48 | 59 | [id=log4j2.contextData] |
49 | 60 | == `log4j2.contextData` |
|
0 commit comments