You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2013/04/12 16:48:25 UTC
svn commit: r1467291 -
/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
Author: fmeschbe
Date: Fri Apr 12 14:48:25 2013
New Revision: 1467291
URL: http://svn.apache.org/r1467291
Log:
SLING-2821 Really log Cookie's value instead of Cookie's string representation (which is not the value)
Modified:
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java?rev=1467291&r1=1467290&r2=1467291&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java (original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java Fri Apr 12 14:48:25 2013
@@ -36,7 +36,7 @@ import org.apache.sling.engine.impl.requ
/**
* The <code>CustomLogFormat</code> class implements the support for log format
* strings similar to the Apache httpd CustomLog configuration.
- *
+ *
* @see <a
* href="http://sling.apache.org/site/client-request-logging.html">Client
* Request Logging</a> for documentation of supported formats.
@@ -57,7 +57,7 @@ class CustomLogFormat {
/**
* Creates a new instance from of this class parsing the log format pattern.
- *
+ *
* @param pattern The pattern to be parsed.
*/
CustomLogFormat(String pattern) {
@@ -71,7 +71,7 @@ class CustomLogFormat {
* Creates a log message from the given <code>request</code> and
* <code>response</code> objects according to the log format from which this
* instance has been created.
- *
+ *
* @param request The {@link RequestLoggerRequest} used to extract values
* for the log message.
* @param response The {@link RequestLoggerResponse} used to extract values
@@ -96,7 +96,7 @@ class CustomLogFormat {
* Returns a string representation of this log format instance. The returned
* String is actually rebuilt from the parsed format string and may be used
* to create another instance of this class with the same format string.
- *
+ *
* @return String representation of this instance.
*/
public String toString() {
@@ -902,15 +902,17 @@ class CustomLogFormat {
}
protected String getValue(RequestLoggerRequest request) {
- Cookie cookie = request.getCookie(this.cookieName);
- return (cookie == null) ? null : escape(cookie.toString());
+ return getValue(request.getCookie(this.cookieName));
}
protected String getValue(RequestLoggerResponse response) {
- Cookie cookie = response.getCookie(this.cookieName);
- return (cookie == null) ? null : escape(cookie.toString());
+ return getValue(response.getCookie(this.cookieName));
+
}
+ private String getValue(final Cookie cookie) {
+ return (cookie == null) ? null : escape(cookie.getValue());
+ }
}
static class HeaderParameter extends BaseParameter {