This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new ce3d2aeaad Add the new identifier to JSON access log
ce3d2aeaad is described below
commit ce3d2aeaad5a0b7d96b94fdcd30e89800a2d7b4a
Author: remm <[email protected]>
AuthorDate: Tue Feb 25 16:02:41 2025 +0100
Add the new identifier to JSON access log
---
java/org/apache/catalina/valves/JsonAccessLogValve.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 7777d94770..9b95892c9c 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -67,6 +67,7 @@ import org.apache.tomcat.util.json.JSONFilter;
* <li>%{xxx}o: responseHeaders</li>
* <li>%{xxx}r: requestAttributes</li>
* <li>%{xxx}s: sessionAttributes</li>
+ * <li>%{xxx}L: identifier</li>
* </ul>
* The attribute list is based on
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
*/
@@ -108,6 +109,7 @@ public class JsonAccessLogValve extends AccessLogValve {
pattern2AttributeName.put(Character.valueOf('o'), "responseHeaders");
pattern2AttributeName.put(Character.valueOf('r'), "requestAttributes");
pattern2AttributeName.put(Character.valueOf('s'), "sessionAttributes");
+ pattern2AttributeName.put(Character.valueOf('L'), "identifier");
SUB_OBJECT_PATTERNS =
Collections.unmodifiableMap(pattern2AttributeName);
}
@@ -179,6 +181,9 @@ public class JsonAccessLogValve extends AccessLogValve {
} else if (ale instanceof CookieElement) {
subTypeLists.get(Character.valueOf('c')).add(wrappedLogElement);
lit.remove();
+ } else if (ale instanceof IdentifierElement) {
+
subTypeLists.get(Character.valueOf('L')).add(wrappedLogElement);
+ lit.remove();
} else {
// Keep the simple items and add separator
lit.add(new CharElement(','));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]