ppkarwasz commented on code in PR #2584: URL: https://github.com/apache/logging-log4j2/pull/2584#discussion_r1605464126
########## src/site/antora/modules/ROOT/pages/manual/markers.adoc: ########## @@ -16,85 +16,115 @@ //// = 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 `Marker` object, labeling them Review Comment: ```suggestion Markers allow "tag" log statements with a link:../javadoc/log4j-api/org/apache/logging/log4j/Marker.html[`Marker`] object, labeling them ``` ########## src/site/antora/modules/ROOT/pages/manual/markers.adoc: ########## @@ -16,85 +16,115 @@ //// = 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 `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. The MarkerManager class provides +a factory method to create a Marker object is used to tag log statements. + +[source, java] +---- +Marker SQL_MARKER = MarkerManager.getMarker("SQL"); Review Comment: I would propose we proceed this way: * we create a `partials/manual/MarkerExample.java` file with AsciiDoc tag comments. * we include the file twice in this page (each time using a different tag), * we create a `attachments/manual/MarkerExample.java` file the just includes the whole partial. * we add a link to the entire example **instead of** printing the example on this page. -- 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