mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
03.33.2013 40af90b02fa4fdec35b76d961de5502703b97854
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, May 3, 2013 14:33 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, May 3, 2013 14:33 +0200
commit40af90b02fa4fdec35b76d961de5502703b97854
tree 041394521e5704aa7d66608750deed496f92b153 tree | zip | gz
parent e9468ae056dbf918729be7d6533f15d254852fc5 view | diff
OPENDJ-879 (CR-1642) Add HTTP access log



Implemented the HTTP access logger by taking inspiration from other loggers.
Configured the new logger everywhere other loggers are configured.
Logged the HTTP request in several places to cover all cases (happy paths, errors, etc.).



config.ldif, 02-config.ldif, HTTPAccessLogPublisherConfiguration.xml, FileBasedHTTPAccessLogPublisherConfiguration.xml, HTTPAccessLogPublisherCfgDefn.properties, FileBasedHTTPAccessLogPublisherCfgDefn.properties: ADDED
Added 2 new objectClasses HTTPAccessLogPublisherConfiguration and FileBasedHTTPAccessLogPublisherConfiguration.

config.properties:
Added new error messages for the HTTP access logger.

HTTPAccessLogger.java, HTTPAccessLogPublisher.java, TextHTTPAccessLogPublisher.java, HTTPRequestInfo.java: ADDED
HTTPRequestInfo.log() prevents double logging.

CollectClientConnectionsFilter.java:
Logged the request info when HttpServletResponse.setStatus(), sendAuthenticationFailure() and onFailure() are called.
Pushed more data to the HTTPRequestContext + switched to use the more specific HttpServletRequest/HttpServletResponse

SdkConnectionAdapter.java:
Logged the request info when close() is called.

LoggerConfigManager.java, TestCaseUtils.java:
Configured the HTTP access logger.

InProcessServerController.java: TO BE REMOVED (by Matt on the native packaging branch)



Sample log:
localhost bjensen [03/May/2013:10:14:54 +0200] "GET /users/_queryFilter=true&_prettyPrint=true HTTP/1.1" 500 "curl/7.27.0"
localhost bjensen [03/May/2013:10:15:05 +0200] "GET /users/_queryFilter=true&_prettyPrint=true HTTP/1.1" 200 "curl/7.27.0"
localhost [03/May/2013:10:15:14 +0200] "GET /users/_queryFilter=true&_prettyPrint=true HTTP/1.1" 200 "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0"
localhost [03/May/2013:10:16:40 +0200] "GET /users/_queryFilter=true&_prettyPrint=true HTTP/1.1" 401 "curl/7.27.0"
localhost [03/May/2013:10:16:50 +0200] "GET /users/_queryFilter=true&_prettyPrint=true HTTP/1.1" 200 "curl/7.27.0"
localhost [03/May/2013:10:16:51 +0200] "GET /favicon.ico/null HTTP/1.1" 404 "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0"
localhost [03/May/2013:10:17:10 +0200] "GET /users/_queryFilter=true&_prettyPrint=true HTTP/1.1" 200 "curl/7.27.0"
7 files modified
8 files added
1465 ■■■■■ changed files
opendj-sdk/opends/resource/config/config.ldif 15 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/resource/schema/02-config.ldif 22 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/FileBasedHTTPAccessLogPublisherConfiguration.xml 316 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/HTTPAccessLogPublisherConfiguration.xml 59 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/admin/messages/FileBasedHTTPAccessLogPublisherCfgDefn.properties 26 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/admin/messages/HTTPAccessLogPublisherCfgDefn.properties 6 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/config.properties 9 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/HTTPAccessLogPublisher.java 101 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/LoggerConfigManager.java 26 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/HTTPAccessLogger.java 148 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/HTTPRequestInfo.java 177 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/TextHTTPAccessLogPublisher.java 409 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/http/CollectClientConnectionsFilter.java 96 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/http/SdkConnectionAdapter.java 17 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java 38 ●●●●● diff | view | raw | blame | history