By default OpenDJ stores access and errors logs as well as a
server process ID file under the logs/ directory.
For the replication service, OpenDJ also keeps a replication log there.
You can also configure a debug log. Furthermore, you can configure policies
about how logs are rotated, and how they are retained. You configure logging
using the dsconfig command.
-
The access log traces the operations the server processes including timestamps, connection information, and information about the operation itself. The access log can therefore grow quickly, as each client request results in at least one new log message.
The following access log excerpt shows a search operation from the local host, with the first three lines wrapped for readability.
[21/Jun/2011:08:01:53 +0200] CONNECT conn=4 from=127.0.0.1:49708 to=127.0.0.1:1389 protocol=LDAP [21/Jun/2011:08:01:53 +0200] SEARCH REQ conn=4 op=0 msgID=1 base="dc=example,dc=com" scope=wholeSubtree filter="(uid=bjensen)" attrs="ALL" [21/Jun/2011:08:01:53 +0200] SEARCH RES conn=4 op=0 msgID=1 result=0 nentries=1 etime=3 [21/Jun/2011:08:01:53 +0200] UNBIND REQ conn=4 op=1 msgID=2 [21/Jun/2011:08:01:53 +0200] DISCONNECT conn=4 reason="Client Unbind"
-
The errors log traces server events, error conditions, and warnings, categorized and identified by severity.
The following errors log excerpt shows log entries about a backup task, with lines wrapped for readability.
[22/Jun/2011:12:32:23 +0200] category=BACKEND severity=NOTICE msgID=9896349 msg=Backup task 20110622123224088 started execution [22/Jun/2011:12:32:23 +0200] category=TOOLS severity=NOTICE msgID=10944792 msg=Starting backup for backend userRoot [22/Jun/2011:12:32:24 +0200] category=JEB severity=NOTICE msgID=8847446 msg=Archived: 00000000.jdb [22/Jun/2011:12:32:24 +0200] category=TOOLS severity=NOTICE msgID=10944795 msg=The backup process completed successfully [22/Jun/2011:12:32:24 +0200] category=BACKEND severity=NOTICE msgID=9896350 msg=Backup task 20110622123224088 finished execution
-
If you use the HTTP Connection Handler, OpenDJ maintains a separate access log in
logs/http-access. This access log, by default configured as the File Based HTTP Access Log Publisher, uses a different format than the LDAP access log. This HTTP access log uses Extended Log File Format with fields described in Microsoft's implementation as well. The following default fields are shown here in the order they occur in the log file.Interface stability: Evolving
cs-host-
Client host name
c-ip-
Client IP address
cs-username-
Username used to authenticate
x-datetime-
Completion timestamp for the HTTP request, which you can configure using the
log-record-time-formatproperty cs-method-
HTTP method requested by the client
cs-uri-query-
Path and query string requested by the client
cs-version-
HTTP version requested by the client
sc-status-
HTTP status code for the operation
cs(User-Agent)-
User-Agent identifier
x-connection-id-
Connection ID used for OpenDJ internal operations
When using this field to match HTTP requests with internal operations in the LDAP access log, first set the access log advanced property,
suppress-internal-operations, tofalse. By default, internal operations do not appear in the LDAP access log. x-etime-
Execution time in milliseconds needed by OpenDJ to service the HTTP request
Missing values are replaced with
-. Tabs separate the fields, and if a field contains a tab character, then the field is surrounded with double quotes. OpenDJ then doubles double quotes in the field to escape them.The following example shows an excerpt of an HTTP access log with the default configuration. Lines are folded and space reformatted for the printed page.
- 192.168.0.15 bjensen 22/May/2013:10:06:18 +0200 GET /users/bjensen?_prettyPrint=true HTTP/1.1 200 curl/7.21.4 3 40 - 192.168.0.15 bjensen 22/May/2013:10:06:52 +0200 GET /groups/Directory%20Administrators?_prettyPrint=true HTTP/1.1 200 curl/7.21.4 4 41 - 192.168.0.12 bjensen 22/May/2013:10:07:07 +0200 GET /users/missing?_prettyPrint=true HTTP/1.1 200 curl/7.21.4 5 9 - 192.168.0.12 - 22/May/2013:10:07:46 +0200 GET /users/missing?_prettyPrint=true HTTP/1.1 401 curl/7.21.4 6 0 - 192.168.0.15 kvaughan 22/May/2013:10:09:10 +0200 POST /users?_action=create&_prettyPrint=true HTTP/1.1 200 curl/7.21.4 7 120
You can configure the
log-formatfor the access log using the dsconfig command. In addition to the default fields, the following standard fields are supported.c-port-
Client port number
s-computername-
Server name where the access log was written
s-ip-
Server IP address
s-port-
Server port number
-
The replication log traces replication events, with entries similar to the errors log. The following excerpt has lines wrapped for readability.
[22/Jun/2011:14:37:34 +0200] category=SYNC severity=NOTICE msgID=15139026 msg=Finished total update: exported domain "dc=example,dc=com" from this directory server DS(24065) to all remote directory servers. [22/Jun/2011:14:37:35 +0200] category=SYNC severity=MILD_WARNING msgID=14745663 msg=Replication server RS(23947) at opendj.example.com/10.10.0.168:8989 has closed the connection to this directory server DS(24065). This directory server will now try to connect to another replication server in order to receive changes for the domain "dc=example,dc=com" [22/Jun/2011:14:37:35 +0200] category=SYNC severity=NOTICE msgID=15138894 msg=The generation ID for domain "dc=example,dc=com" has been reset to 3679640
Notice that the replication log does not trace replication operations. Use the external change log instead to get notifications about changes to directory data over protocol. You can alternatively configure an audit log, which is a type of access log that dumps changes in LDIF.
-
A debug log traces details needed to troubleshoot a problem in the server. Debug logs can grow large quickly, and therefore no debug logs are enabled by default.
Each log depends on a log publisher, whose type corresponds to the type of log. OpenDJ uses file-based log publishers. The design allows for custom log publishers, however, which could publish the logs elsewhere besides a file.
For debug logging, you also set a debug target to control what gets logged.

