1 package ch.qos.logback.access.pattern;
2
3 import java.util.Enumeration;
4
5 import ch.qos.logback.access.spi.AccessEvent;
6 import ch.qos.logback.core.CoreConstants;
7
8
9
10
11
12
13
14
15
16
17 public class FullRequestConverter extends AccessConverter {
18
19 @Override
20 public String convert(AccessEvent ae) {
21 StringBuffer buf = new StringBuffer();
22 buf.append(ae.getRequestURL());
23 buf.append(CoreConstants.LINE_SEPARATOR);
24
25 Enumeration headerNames = ae.getRequestHeaderNames();
26 while(headerNames.hasMoreElements()) {
27 String name = (String) headerNames.nextElement();
28 buf.append(name);
29 buf.append(": ");
30 buf.append(ae.getRequestHeader(name));
31 buf.append(CoreConstants.LINE_SEPARATOR);
32 }
33 buf.append(CoreConstants.LINE_SEPARATOR);
34 buf.append(ae.getRequestContent());
35 return buf.toString();
36 }
37
38 }