vy commented on code in PR #2584:
URL: https://github.com/apache/logging-log4j2/pull/2584#discussion_r1607765181


##########
src/site/antora/modules/ROOT/pages/manual/markers.adoc:
##########
@@ -16,85 +16,120 @@
 ////
 = Markers
 
-One of the primary purpose of a logging framework is to provide the
-means to generate debugging and diagnostic information only when it is
-needed, and to allow filtering of that information so that it does not
-overwhelm the system or the individuals who need to make use of it. As
-an example, an application desires to log its entry, exit and other
-operations separately from SQL statements being executed, and wishes to
-be able to log queries separate from updates. One way to accomplish this
-is shown below:
-
-[source,java]
+Markers allow "tag" log statements with a
+link:../javadoc/log4j-api/org/apache/logging/log4j/Marker.html[`Marker`]
+object, labeling them as belonging to a specific type. 
+For example, developers can use markers to tag log statements related to a 
particular subsystem or functionality.
+
+By using markers, it is possible to filter log statements based on the `Marker`
+and display only those log statements that are of interest, such as those
+related to XML processing or SQL queries.
+
+Markers offer more fine-grained control over log filtering beyond log levels 
or package names.
+
+[#create]
+== Creating Markers
+
+To create a `Marker`, use the `MarkerManager` class as follows:
+
+[source, java]
+----
+Marker SQL_MARKER = MarkerManager.getMarker("SQL");
+----
+
+Since a `Marker` is reusable across multiple log statements, storing it in a 
`static final` field makes it a constant.
+Once created, use it as the first argument in the log statement:
+
+[source, java]
+----
+logger.debug(SQL_MARKER, "Here is my SQL related message");

Review Comment:
   ```suggestion
   LOGGER.debug(SQL_MARKER, "Here is my SQL related message");
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to