Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
FIX: logging request Protocol and correct hour, change parameter in c…
Browse files Browse the repository at this point in the history
…all to log4j2 LogManager.getLogger(...)
  • Loading branch information
vilaca committed Oct 28, 2013
1 parent 7bde41f commit db7f88e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/pt/go2/application/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class Server {

static private final Configuration config = new Configuration();

static private final Logger logger = LogManager.getLogger(Server.class
.getName());
static private final Logger logger = LogManager.getLogger(Server.class);

static private BufferedWriter accessLog = null;

Expand Down Expand Up @@ -196,13 +195,15 @@ static void printLogMessage(final HttpExchange params,

sb.append(params.getRemoteAddress().getAddress().getHostAddress());
sb.append(" - - [");
sb.append(new SimpleDateFormat("dd/MMM/yyyy:hh:mm:ss Z")
sb.append(new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z")
.format(new Date()));
sb.append("] \"");
sb.append(params.getRequestMethod());
sb.append(" ");
sb.append(params.getRequestURI().toString());
sb.append(" HTTP/1.0\" ");
sb.append(" ");
sb.append(params.getProtocol());
sb.append(" ");
sb.append(response.getHttpErrorCode());
sb.append(" ");
sb.append(response.getSize());
Expand Down

0 comments on commit db7f88e

Please sign in to comment.