| 495 | } |
| 496 | |
| 497 | protected final String logChannel() { |
| 498 | if (request.headers().contains("X-Forwarded-For")) { |
| 499 | String inetAddress; |
| 500 | String proxyChain = request.headers().get("X-Forwarded-For"); |
| 501 | int firstComma = proxyChain.indexOf(','); |
| 502 | if (firstComma != -1) { |
| 503 | inetAddress = proxyChain.substring(0, proxyChain.indexOf(',')); |
| 504 | } else { |
| 505 | inetAddress = proxyChain; |
| 506 | } |
| 507 | return "[id: 0x" + Integer.toHexString(chan.hashCode()) |
| 508 | + ", /" + inetAddress + " => " + chan.getLocalAddress() + ']'; |
| 509 | } else { |
| 510 | return chan.toString(); |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | protected final void logInfo(final String msg) { |
| 515 | if (logger().isInfoEnabled()) { |