| Title: 5.3 - Logs |
| NavPrev: 5.2-start-stop.html |
| NavPrevText: 5.2 - Starting and Stopping the server |
| NavUp: 5-administration.html |
| NavUpText: 5 - Administration |
| NavNext: 5.4-replication.html |
| NavNextText: 5.4 - Replication |
| Notice: Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| . |
| http://www.apache.org/licenses/LICENSE-2.0 |
| . |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| # 5.3 - Logs |
| |
| ## 5.3.1 Logs overview |
| |
| ApacheDS internally uses SLF4J as a facade for logs and Log4J is bundled in the standalone ApacheDS distributions. |
| |
| Logs can be configured by modifying the _**log4j.properties**_ file which can be found in the _**conf**_ directory of the server instance (see the previous chapter "[5.1 - Layout](5.1-layout.html)"). |
| |
| Here is the Log4J configuration that comes with ApacheDS: |
| |
| :::Text |
| ############################################################################# |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| ############################################################################# |
| log4j.rootCategory=WARN, F |
| |
| log4j.appender.F=org.apache.log4j.RollingFileAppender |
| log4j.appender.F.File=${apacheds.log.dir}/apacheds.log |
| log4j.appender.F.MaxFileSize=100MB |
| log4j.appender.F.MaxBackupIndex=3 |
| log4j.appender.F.layout=org.apache.log4j.PatternLayout |
| log4j.appender.F.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n |
| |
| # Specific loggers (useful for debugging) |
| #log4j.logger.jdbm.recman.BaseRecordManager=DEBUG |
| #log4j.logger.org.apache.directory.server.OPERATION_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.OPERATION_TIME=DEBUG |
| #log4j.logger.org.apache.directory.api.CODEC_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.ACI_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.PROVIDER_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.CONSUMER_LOG=DEBUG |
| #log4j.logger.org.apache.directory.CURSOR_LOG=DEBUG |
| #log4j.logger.org.apache.directory.api=DEBUG |
| #log4j.logger.org.apache.directory.server=DEBUG |
| #log4j.logger.net.sf.ehcache=DEBUG |
| #log4j.logger.org.apache.mina=DEBUG |
| |
| ## 5.3.2 Default log level |
| |
| By default, ApacheDS ships with a default log level set to **WARN** as indicated in the first line of the _**log4j.properties**_ file: |
| |
| :::Text |
| log4j.rootCategory=WARN, F |
| |
| This value can be modified to any of the seven log levels supported by Log4J: |
| |
| <center> |
| |
| | Level | Description | |
| |:-:|---| |
| | _**OFF**_ | Highest possible rank and is intended to turn off logging. | |
| | _**FATAL**_ | Very severe error events that will presumably lead the application to abort. | |
| | _**ERROR**_ | Error events that might still allow the application to continue running. | |
| | _**WARN**_ | Potentially harmful situations. | |
| | _**INFO**_ | Informational messages that highlight the progress of the application at coarse-grained level. | |
| | _**DEBUG**_ | Fine-grained informational events that are most useful to debug an application. | |
| | _**TRACE**_ | Finer-grained informational events than the DEBUG. | |
| |
| </center> |
| |
| Please refer to the [**Log4J Manual**](http://logging.apache.org/log4j/1.2/manual.html) for more details. |
| |
| ## 5.3.2 ApacheDS specific loggers |
| |
| Bundled at the end of the _**log4j.properties**_ file, are a set of specific loggers dedicated to a particular kind of events: |
| |
| :::Text |
| # Specific loggers (useful for debugging) |
| #log4j.logger.jdbm.recman.BaseRecordManager=DEBUG |
| #log4j.logger.org.apache.directory.server.OPERATION_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.OPERATION_TIME=DEBUG |
| #log4j.logger.org.apache.directory.api.CODEC_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.ACI_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.PROVIDER_LOG=DEBUG |
| #log4j.logger.org.apache.directory.server.CONSUMER_LOG=DEBUG |
| #log4j.logger.org.apache.directory.CURSOR_LOG=DEBUG |
| #log4j.logger.org.apache.directory.api=DEBUG |
| #log4j.logger.org.apache.directory.server=DEBUG |
| #log4j.logger.net.sf.ehcache=DEBUG |
| #log4j.logger.org.apache.mina=DEBUG |
| |
| The table below summarizes what each specific logger does: |
| |
| <center> |
| |
| | Logger | Description | |
| |---|---| |
| | **jdbm.recman.BaseRecordManager** | Logs all information related to the JDBM database used to store the entries. | |
| | **org.apache.directory.server.OPERATION_LOG** | Logs all executed operations (search, add, delete, etc.). | |
| | **org.apache.directory.server.OPERATION_TIME** | Logs the time each operation takes to execute. | |
| | **org.apache.directory.api.CODEC_LOG** | Logs all incoming and outgoing LDAP Protocol requests/responses. | |
| | **org.apache.directory.server.ACI_LOG** | Logs all information related to the ACI system. | |
| | **org.apache.directory.server.PROVIDER_LOG** | Logs all information related to the Replication Provider(s). | |
| | **org.apache.directory.server.CONSUMER_LOG** | Logs all information related to the Replication Consumer(s). | |
| | **org.apache.directory.CURSOR_LOG** | Logs all information related to the Cursors handling the search of entries in the database. | |
| | **org.apache.directory.api** | A general logger which logs all classes of the Apache Directory LDAP API. | |
| | **org.apache.directory.server** | A general logger which logs all classes of ApacheDS. | |
| | **net.sf.ehcache** | A general logger which logs all classes of the Ehcache API. | |
| | **org.apache.mina** | A general logger which logs all classes of the Apache Mina API. | |
| |
| </center> |
| |
| These loggers are deactivated by default to prevent them interfering with the root log level. Make sure to uncomment those you would like to activate (by removing the '_#_' character in front of the line) and set the dedicated log level according to the kind of information you're looking for. |