 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file.
19 package examples.apache;
21 import java.text.DateFormat;
22 import java.text.SimpleDateFormat;
23 import java.util.Date;
41 protected static final transient DateFormat
m_dateFormat =
new SimpleDateFormat(
"d-MMM-yyyy HH:mm:ss z");
73 public LogLine(String ip,
long timestamp,
int timezone, Request req,
StatusCode code,
int size)
87 StringBuilder out =
new StringBuilder();
91 out.append(
" \"").append(
m_request.toString()).append(
"\" ");
93 return out.toString();
96 protected static String
formatDate(
long timestamp,
long timezone)
98 Date d =
new Date(timestamp);
110 case INTERNAL_SERVER_ERROR:
120 public static class Request
124 protected String m_url;
126 protected Method m_method;
128 public Request(
Method m, String url)
138 return m_method +
" " + m_url +
" HTTP/2";
Request m_request
The HTTP request made.
Representation of a line of Apache's access log.
String m_ipAddress
The IP address of an HTTP request.
The possible status codes associated to each request.
StatusCode m_statusCode
The status code that the server sends back to the client.
long m_timestamp
The date the request was made.
static final transient DateFormat m_dateFormat
A formatter for dates.
int m_size
The size of the object requested.
static String formatDate(long timestamp, long timezone)
int m_timeZone
The GMT offset of the timestamp.
LogLine(String ip, long timestamp, int timezone, Request req, StatusCode code, int size)
static int getCode(StatusCode code)