Skip to content

Commit eb4f792

Browse files
committed
wording improvements for clarity
1 parent 7077822 commit eb4f792

File tree

1 file changed

+27
-27
lines changed
  • src/site/antora/modules/ROOT/pages/manual

1 file changed

+27
-27
lines changed

src/site/antora/modules/ROOT/pages/manual/async.adoc

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
////
1717
= Asynchronous loggers
1818
19-
Asynchronous logging is a technique to improve application logging performance by executing all I/O operations in a separate thread.
19+
Asynchronous logging is a technique that improves application logging performance by executing all I/O operations in a separate thread.
2020
2121
Log4j offers out-of-the-box two different asynchronous logging solutions:
2222
2323
Asynchronous appender::
24-
A classical queue-based asynchronous appender, which is available since Log4j 1.
24+
An asynchronous appender is a classical queue-based asynchronous appender which is available since Log4j 1.
2525
+
2626
See xref:manual/appenders/delegating.adoc#AsyncAppender[Asynchronous appender] for more details.
2727
2828
Asynchronous loggers::
29-
Asynchronous loggers are a new feature available since Log4j 2.
29+
Asynchronous loggers have been a new feature since Log4j 2.
3030
They are based on
3131
{lmax-disruptor-url}[LMAX Disruptor],
3232
a lock-free inter-thread communication library, instead of queues, resulting in higher throughput and lower latency.
@@ -35,9 +35,9 @@ The rest of this chapter is dedicated to this new component.
3535
3636
[WARNING]
3737
====
38-
Logging performance depends greatly on the architecture of your application and the way you use logging.
39-
The solutions offered by this chapter should be evaluated using benchmarks against your own application.
40-
If benchmarks and profiling don't show a statistically significant difference between asynchronous and synchronous logging solutions, the latter one is recommended, since it is the simplest one.
38+
Logging performance depends significantly on the architecture of your application and the way you use logging.
39+
The solutions offered by this chapter should be evaluated using benchmarks against your application.
40+
If benchmarks and profiling don't show a statistically significant difference between asynchronous and synchronous logging solutions, the latter is recommended since it is the simplest.
4141
====
4242
4343
include::partial$manual/async-trade-offs.adoc[leveloffset=+1]
@@ -58,7 +58,7 @@ You can:
5858
** <<AllAsync>>, which gives a better performance,
5959
** <<MixedSync-Async>>, which gives more flexibility.
6060
61-
Under the hood these methods use different Log4j plugins, but also share a
61+
Under the hood, these methods use different Log4j plugins but also share a
6262
<<common-configuration-properties,set of common configuration properties>>.
6363
6464
[#AllAsync]
@@ -76,10 +76,10 @@ This will create a different logger context and disruptor for each classloader i
7676
7777
[IMPORTANT]
7878
====
79-
When using an asynchronous logger context you should use only `Root` and `Logger` elements (cf.
79+
When using an asynchronous logger context, you should only use the `Root` and `Logger` elements (cf.
8080
xref:manual/configuration.adoc#configuring-loggers[Logger configuration]).
8181
82-
If you use `AsyncRoot` and `AsyncLogger` configuration elements, two asynchronous barriers will be created instead of one, which will impair performance.
82+
If you use `AsyncRoot` and `AsyncLogger` configuration elements, two asynchronous barriers will be created instead of one, impairing performance.
8383
====
8484
8585
[#SysPropsAllAsync]
@@ -91,11 +91,11 @@ Beyond the <<common-configuration-properties,common configuration properties>>,
9191
9292
include::partial$manual/systemproperties/properties-async-logger.adoc[leveloffset=+2]
9393
94-
* the generic behavior of asynchronous components, such as the queue full policy and message formatting.
95-
+
96-
See xref:manual/systemproperties.adoc#properties-async[common asynchronous logging configurations] for more details.
94+
* The generic behavior of asynchronous components, such as the queue full policy and message formatting.
95+
+
96+
For more details, see xref:manual/systemproperties.adoc#properties-async[common asynchronous logging configurations].
9797
98-
* the parameters of the disruptor, such as the size of the ring buffer and the wait strategy to use.
98+
* The parameters of the disruptor, such as the size of the ring buffer and the wait strategy to use.
9999
+
100100
See xref:manual/systemproperties.adoc#properties-async-logger[asynchronous logger configuration] for more details.
101101
@@ -111,11 +111,11 @@ See xref:manual/systemproperties.adoc#property-sources[Property Sources] for mor
111111
=== Mixing synchronous and asynchronous loggers
112112
113113
Synchronous and asynchronous loggers can be combined in a single configuration.
114-
This gives you more flexibility at the cost of a slight loss in performance (compared to making all loggers asynchronous).
114+
This gives you more flexibility at the cost of a slight performance loss (compared to making all loggers asynchronous).
115115
116-
In order to use this configuration, you need to keep the
116+
To use this configuration, you need to keep the
117117
xref:manual/systemproperties.adoc#log4j2.contextSelector[`log4j2.contextSelector`] at its default value and use one of the
118-
`AsyncRoot` and `AsyncLogger` configuration elements to designate the loggers that you want to be asynchronous.
118+
`AsyncRoot` and `AsyncLogger` configuration elements designate the loggers you want to be asynchronous.
119119
120120
A configuration that mixes asynchronous loggers might look like:
121121
@@ -154,14 +154,14 @@ include::example$manual/async/mixed-async.properties[lines=28..-1]
154154
----
155155
====
156156
<1> All the appenders referenced by `Root` and `Logger` are called synchronously.
157-
This is especially important for audit logging, since exceptions can be forwarded to the caller.
157+
This is especially important for audit logging since exceptions can be forwarded to the caller.
158158
<2> All the appenders references by `AsyncRoot` and `AsyncLogger` are called asynchronously.
159159
These log statements will cause a smaller latency for the caller.
160160
161161
[[SysPropsMixedSync-Async]]
162162
=== Tuning a mixed synchronous/asynchronous configuration
163163
164-
Since all `AsyncRoot` and `AsyncLogger` components share the same Disruptor instance, its configuration is available through configuration properties.
164+
Since all `AsyncRoot` and `AsyncLogger` components share the same Disruptor instance, their configuration is available through configuration properties.
165165
166166
Beyond the <<common-configuration-properties,common configuration properties>>, the following additional elements are configurable:
167167
@@ -177,7 +177,7 @@ See xref:manual/systemproperties.adoc#property-sources[Property Sources] for mor
177177
[#common-configuration-properties]
178178
=== Common configuration properties
179179
180-
Regardless of the way you configure asynchronous loggers in Log4j, you can use the following properties to further tune your installation:
180+
Regardless of the way you configure asynchronous loggers in Log4j, you can use the following properties to tune your installation further:
181181
182182
include::partial$manual/systemproperties/properties-async.adoc[leveloffset=+2]
183183
@@ -186,7 +186,7 @@ include::partial$manual/systemproperties/properties-async.adoc[leveloffset=+2]
186186
187187
The system properties mentioned in the section above allow only to choose from among a fixed set of wait strategies.
188188
189-
In order to use a custom wait strategy you need to:
189+
To use a custom wait strategy, you need to:
190190
191191
. Use the <<MixedSync-Async,mixed sync/async configuration method>> above,
192192
. Implement the interface link:../javadoc/log4j-core/org/apache/logging/log4j/core/async/AsyncWaitStrategyFactory.html[`AsyncWaitStrategyFactory`]; the implementation must have a public no-arg constructor,
@@ -232,21 +232,21 @@ include::example$manual/async/custom-wait-strategy.properties[lines=17..-1]
232232
== Location information
233233
234234
xref:manual/layouts.adoc#LocationInformation[Computing the location information (i.e., the caller class, method, file, and line number) of a log event is an expensive operation.]
235-
The impact on asynchronous loggers and appenders is even higher, since the component must decide whether to compute it or not **before** crossing the asynchronous barrier.
236-
Hence, the location information is disabled by default for asynchronous loggers and appenders.
237-
In order to enable it for a certain logger, set its xref:manual/configuration.adoc#logger-attributes-includeLocation[`includeLocation`] attribute to `true`.
235+
The impact on asynchronous loggers and appenders is even higher since the component must decide whether to compute it or not **before** crossing the asynchronous barrier.
236+
Location information is turned off by default for asynchronous loggers and appenders.
237+
To enable it for a certain logger, set its xref:manual/configuration.adoc#logger-attributes-includeLocation[`includeLocation`] attribute to `true`.
238238
239239
[id=exception-handler]
240240
== Exception handler
241241
242-
In order to handle exceptions that occur on the asynchronous thread, you can configure a custom
242+
To handle exceptions that occur on the asynchronous thread, you can configure a custom
243243
https://lmax-exchange.github.io/disruptor/javadoc/com.lmax.disruptor/com/lmax/disruptor/ExceptionHandler.html[`ExceptionHandler<T>`].
244244
245245
The exact type of handler depends on the configuration mode:
246246
247247
Full asynchronous::
248248
+
249-
If all the loggers are asynchronous you need to:
249+
If all the loggers are asynchronous, you need to:
250250
+
251251
* implement an link:../javadoc/log4j-core/org/apache/logging/log4j/core/async/RingBufferLogEvent.html[`ExceptionHandler<? super RingBufferLogEvent>`]
252252
* set its fully qualified class name as value of the
@@ -255,10 +255,10 @@ configuration property.
255255
256256
Mixed synchronous/asynchronous::
257257
+
258-
If you use a mix of synchronous and asynchronous loggers you need to:
258+
If you use a mix of synchronous and asynchronous loggers, you need to:
259259
+
260260
* implement a
261261
link:../javadoc/log4j-core/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.Log4jEventWrapper.html[`ExceptionHandler<? super AsyncLoggerConfigDisruptor.Log4jEventWrapper>`]
262-
* set its fully qualified class name as value of the
262+
* set its fully qualified class name as the value of the
263263
xref:manual/systemproperties.adoc#log4j2.asyncLoggerConfigExceptionHandler[`log4j2.asyncLoggerConfigExceptionHandler`]
264264
configuration property.

0 commit comments

Comments
 (0)