Enabling tracing
Enabling tracing allows you to monitor the actions that are performed against the SQL database, which can be valuable information for troubleshooting and tuning the database. There are two configurations that you can use to turn on the tracing.
About this task
Procedure
Configuration 1
To enable tracing for applications that use the Mongo API against the Wire Listener, complete the following steps.Example
The following is an example of how to enable the Wire Listener, NOSQL API and JDBC driver trace on windows:
wplistener.bat -start -mongoPort 27017 -host localhost:50000 -user user_id -password password -dbname db_name -debug -logPath C:\temp -noSQLPropertyPath C:\temp
Example 2
The following example is for the nosql.properties file:
nosql.traceFile=/tmp/nosql.txt
nosql.traceLevel=ALL
Example 3
The following example is for the DB2JccConfiguration.properties file:
db2.jcc.override.traceFile=/tmp/jdbcTrace.txt
db2.jcc.override.traceFileAppend=true
db2.jcc.override.TraceLevel=-1
Configuration 2
To enable tracing for applications that use the Mongo API against the Wire Listener that is written with NOSQL API, refer to the following example:- Enable tracing for NOSQL API and JDBC driver by using the -D JVM option, as in the following example.
java -Dnosql.traceFile=/tmp/nosql.txt -Dnosql.traceLevel=ALL -Ddb2.jcc.override.traceFile=c:\temp\jdbctrace.txt -Ddb2.jcc.override.TraceLevel=-1 app
where
app is the compiled Java
application.Configuration 3
To enable tracing for applications that use the Mongo API against the Wire Listener, start the wirelistener with the following options:
- -debug: To enable wire listener trace.
- -nosqltrc: To enable nosql trace for wire listener.
- -jcctrc: To enable jcc trace for wire listener.
- -logPath: To specify a directory where above trace should get saved. Default location is json/logs directory.
Example
To enable only nosql trace for wire
listener:
wplistener -start -mongoPort 27017 -dbName jsdb -usid user -password pwd -nosqltrc -logPath C:\temp
To enable only jcc trace for wire
listener:
wplistener -start -mongoPort 27017 -userid user -password pwd -dbName jsdb -jcctrc -logPath C:\temp
To enable nosql and jcc trace for wire listener at default logPath
directory:
wplistener -start -mongoPort 27017 -userid user -password pwd -dbName jsdb -debug -nosqltrc -jcctrc -logPath C:\temp
To enable all three traces at
once:
wplistener -start -mongoPort 27017 -userid user -password pwd -dbName jsdb -debug -nosqltrc -jcctrc -logPath C:\temp