Skip to content

Commit a0c2e8d

Browse files
committed
minor corrections/improvements
1 parent 85c61ca commit a0c2e8d

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/site/antora/modules/ROOT/pages/5min.adoc

+15-14
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
1818
= Learn Log4j in 5 minutes!
1919
20-
You need a crash course on Log4j?
21-
You are at the right place!
20+
Do you need a crash course on Log4j?
21+
You have come to the right place!
22+
If you are looking for a more detailed read, please see {logging-services-url}/what-is-logging.html[What is logging?].
2223
2324
[#what]
2425
== What is logging and Log4j?
@@ -33,28 +34,28 @@ private void truncateTable(String tableName) {
3334
}
3435
----
3536
36-
This provides observability into an application's runtime. (See {logging-services-url}/what-is-logging.html[What is logging?] page for a longer read.)
37+
This provides observability into an application's runtime.
3738
3839
But we can do way better than a `printf()` statement!
3940
4041
* Enhance the message with additional information (timestamp, class & method name, line number, host, severity, etc.)
41-
* Write the message in a different way, using a different **layout** (CSV, JSON, etc.)
42+
* Write the message differently, using a different **layout** (CSV, JSON, etc.)
4243
* Write the message to a different medium, using a different **appender** (file, socket, database, queue, etc.)
4344
* Write only some of the messages, using a **filter** (e.g. filter by severity, content, etc.)
4445
45-
Log4j is versatile, industrial-grade Java logging framework delivering all these and more in one product.
46+
Log4j is a versatile, industrial-grade Java logging framework delivering all these and more in one product.
4647
It is essentially composed of a **logging API** and its **implementation**:
4748
4849
Log4j API::
4950
The logging API your code (programmatically) logs through.
5051
This needs to be available at compile-time and no configuration is needed.
5152
5253
Log4j Core::
53-
The logging implementation which is responsible for filtering, routing, encoding, and appending log events.
54+
The logging implementation is responsible for filtering, routing, encoding, and appending log events.
5455
This needs to be available at runtime and configured by the user.
5556
5657
[#logging]
57-
== How do I log using Log4j?
58+
== How do I write logs using Log4j?
5859
5960
Add the `log4j-api` dependency to your application:
6061
@@ -170,7 +171,7 @@ Let's try to walk through the most common ones.
170171
==== Pass exception as the last extra argument
171172
172173
* [ ] Don't call `Throwable#printStackTrace()`!
173-
This not only circumvents the logging, but can also leak sensitive information!
174+
This not only circumvents the logging but can also leak sensitive information!
174175
+
175176
[source,java]
176177
----
@@ -187,7 +188,7 @@ This prevents the log event from getting enriched with the exception.
187188
----
188189
189190
* [ ] Don't provide both `Throwable#getMessage()` and `Throwable` itself!
190-
This bloats the log message with duplicate exception message.
191+
This bloats the log message with a duplicate exception message.
191192
+
192193
[source,java]
193194
----
@@ -210,7 +211,7 @@ If you are using `String` concatenation while logging, you are doing something v
210211
* [ ] Don't use `String` concatenation to format arguments!
211212
This circumvents the handling of arguments by message type and layout.
212213
More importantly, **this approach is prone to attacks!**
213-
Imagine `userId` being provided by user with the following content:
214+
Imagine `userId` being provided by the user with the following content:
214215
`placeholders for non-existing args to trigger failure: {} {} \{dangerousLookup}`
215216
+
216217
[source,java]
@@ -330,11 +331,11 @@ Save the following XML document to `src/**main**/resources/log4j2.xml`:
330331
331332
</Configuration>
332333
----
333-
<1> xref:manual/appenders.adoc[Appenders] are responsible for writing log events to console, file, socket, database, etc.
334+
<1> xref:manual/appenders.adoc[Appenders] are responsible for writing log events to the console, file, socket, database, etc.
334335
<2> xref:manual/appenders.adoc#ConsoleAppender[Console Appender] is used to write logs to the console.
335336
<3> xref:manual/json-template-layout.adoc[JSON Template Layout] is used to encode log events in JSON.
336-
<4> Log events generated by classes in the `com.mycompany` package (incl. its subpackages) and that are of level `INFO` and higher (i.e., `WARN`, `ERROR`, `FATAL`) will be consumed.
337-
<5> Unless specified otherwise, log events of level `WARN` and and higher will be consumed.
337+
<4> Log events generated by classes in the `com.mycompany` package (incl. its sub packages) and that are of level `INFO` and higher (i.e., `WARN`, `ERROR`, `FATAL`) will be consumed.
338+
<5> Unless specified otherwise, log events of level `WARN` and higher will be consumed.
338339
<6> Unless specified otherwise, log events will be forwarded to the `console` appender defined earlier.
339340
340341
You are strongly advised to use a different Log4j configuration for tests.
@@ -471,5 +472,5 @@ See the xref:manual/architecture.adoc[] page.
471472
472473
Support::
473474
Confused?
474-
Having problem while setting up Log4j?
475+
Having a problem while setting up Log4j?
475476
See the {logging-services-url}/support.html[Support] page.

0 commit comments

Comments
 (0)