Enabling tracing from the command-line interface
An administrator can enable the trace facility and request for specific processes like directory server or commands like ldif2db to print trace information. Trace information can be sent to the command line or to a file.
Procedure
- Enable the trace facility. From the command line, issue
the following command:
OR,ldtrc onidsldaptrace -p adminSereverPort -h host_name -D cn=adminDN \ -w adminPW -l onNote: You can use the idsldaptrace command from any system that has the directory server client package installed. The Administration Server must be running for this command to work. - Enable the tracing for a specific process or a command.
Select a debug level for the trace. For example, specifying a bit mask value of 65535 turns on full debug output and generates the most complete information. For more information about debug levels, see Server debug mode.You can use one of the following options to set the debug level that is base on the process or command that you want to trace.
- Set the LDAP_DEBUG environment variable to
specify the debug level. Set this environment variable with a value
that you want to use for debug_mask. If the LDAP_DEBUG environment
variable is set and you use the -d option with
a different debug mask, the debug mask that is specified with the -d option
overrides the debug mask that is specified in the environment variable.On AIX®, Linux®, and Solaris platforms:
$export LDAP_DEBUG=debug_levelOn Windows platform:
To disable the environment variable, use the unset LDAP_DEBUG command.C:\> set LDAP_DEBUG=debug_level - For a directory server instance, you can enable tracing at the
server startup by setting the attributes in the server configuration
file. Set the ibm-slapdStartupTraceEnabled attribute
to TRUE in the server configuration file. There
are configuration options for setting the level by using the ibm-slapdTraceMessageLevel attribute
and routing the output to a file by specifying a file name as value
for the ibm-slapdTraceMessageLog attribute. The
following example shows the ibm-slapdStartupTraceEnabled attribute
that is set to true in the
cn=Configurationentry:
Restart the directory server instance for the changes to take effect.idsldapmodify -p port -D cn=adminDN -w adminPW dn: cn=Configuration changetype: modify replace: ibm-slapdStartupTraceEnabled ibm-slapdStartupTraceEnabled: TRUE f- replace: ibm-slapdTraceMessageLevel ibm-slapdTraceMessageLevel: 0xFFFF - replace: ibm-slapdTraceMessageLog ibm-slapdTraceMessageLog: /var/ibmslapd.trace.log Operation 0 modifying entry cn=ConfigurationNote: To disable tracing modify the value of the ibm-slapdStartupTraceEnabled attribute to False by using the idsldapmodify command. - You can also dynamically enable tracing after a directory server
instance starts by using the idsldaptrace command.To start tracing a directory server, issue the idsldaptrace command of the following format:
To stop tracing of a directory server, issue the idsldaptrace command of the following format:idsldaptrace -h host_name -D cn=adminDN -w adminPW -p port \ -m debug_level -o output_file -t startidsldaptrace -h host_name -D cn=adminDN -w adminPW -p port -t stop
- Set the LDAP_DEBUG environment variable to
specify the debug level. Set this environment variable with a value
that you want to use for debug_mask. If the LDAP_DEBUG environment
variable is set and you use the -d option with
a different debug mask, the debug mask that is specified with the -d option
overrides the debug mask that is specified in the environment variable.
- When you are finished with tracing, you must disable tracing.
You can use one of the following options to stop tracing depending
on the method that you used to enable tracing.
- To stop tracing, issue the following command:
ORldtrc offidsldaptrace -p adminSereverPort -h host_name -D cn=adminDN \ -w adminPW -l offNote: You can use the ldaptrace command from any system that has the directory server installed. The Administration Server must be running for this command to work.
- To stop tracing, issue the following command: