Using PPM Action Trace

Document ID : KB000009353
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

Please provide instructions on how to use SQL Trace for CA PPM

Environment:
v13 and above
Instructions:

Steps for Release 15.1 and Later:

In 15.1, the supported method is to update the resource's (user's) "Action Tracing" field. 

Please note that enabling Action tracing on multiple users simultaneously will overwrite the content/trace files. 

After enabling Action Tracing on the resource, the user will need to logout and login and then you will find a file called: "app-trace.xml" in <Clarity Home>/logs/.

For example:

actionTracingOnResource.png

To gather the actual SQL statements used in the actions, select:  Trace Statements and Results

Please note: 
Tracing expires and reverts back to Trace Off after 5 days.
 

Steps for Releases Prior to 15.1:

SQLTrace activities are now referred to as 'Action Tracing'. The application will log entries for actions performed in the application when the configuration is set to capture the activities.

Stock configuration of Clarity System Administration (CSA) application provides an entry for the Clarity Administration (admin) user in which Action Trace can be easily turned on by simply changing the Category Priority level from FATAL to Trace or All.

If access is provided, <server>/niku/nu#action:security.logs can be entered from the browser URL.
Click Logs > Edit Configuration.

The instructions provided here, will allow the Clarity Administrator to execute steps to create separate Action Trace Log files for specific end-users.

  1. Log into Clarity System Administration application (CSA)
     
  2. Navigate to the Server > Logs > Edit Configuration page (default configuration shown)

    Figure 1
     
  3. Be sure the option 'Detect Log Configuration Changes Automatically' is checked so that when you are updating the page to enable and disable the Action Trace it is effective immediately
     
  4. Scroll down the page to the 'Appenders' Section : Here you will create a new appender file that will store the Action Trace details
     
  5. Copy the existing Appender named 'XML' (this pre-existing entry is used for the 'admin' trace)

    Figure 2
     
  6. Edit the newly-created 'XML - copy' Appender line item for a specific user (myuser) - File name = ../logs/trace_myuser.xml > Click 'SAVE' button located at the top or bottom of the page
     
  7. Now that a separate Appender File name has been created, we can create an entry to turn on Action trace for this user. Scroll up the page to the 'Categories' section.
     
  8. Click 'ADD CATEGORY' button : this will create a new line item at the end of the Categories list with 'com.niku' as the Category Name
     
  9. Update this line item with the following details as shown: Other Name, Appender, Priority, Additive

    NOTE: Be sure to enter the User Name using the same case-sensitive characters as defined in the Clarity Administration Resource User Name field. In the following example, the user name is using all lower-case characters for 'myuser', which matches the definition in Clarity.

    Figure 3
     
  10. Click 'SAVE' button at the bottom or top of the page > the saved changes will now appear as shown for this line item

    Figure 4
  11. For Websphere and WebLogic Environments: 

    Run the following two commands from a command line on the Clarity server.
     
    1. admin general upload-config
    2. admin general upload-config -Dfile=logger.xml 
       
  12. Because you set the Priority of the Category to All, a yellow Alert message will appear on the Logs Configuration page. This serves as a reminder to disable the Action Trace later

    Figure 5
     
  13. After performing the Action trace activity, be sure to remove the Category line item or change the Category Priority to FATAL to turn off the Action Trace for this specific user
     
  14. The log files generated from this configuration will be found in the 'logs' directory on the Clarity application server

    Figure 6

 

Action Trace logging in V13 no longer uses the SQLTRACE_ACTIVE trace levels in the CMN_SEC_USERS table as described in technical articles for prior releases. The detail level is now controlled by the logging priority level for the 'trace.server' category. The Debug level provides performance information, query text, parameter values, and resource usage - equivalent to the trace level "4" in the previous versions. The Trace level provides the Debug information plus the result sets, equivalent to trace level "8". Make sure to re-login after each change to a user-specific Action Trace logging configuration.

NOTE: With r13.x and onwards the following 2 flags can/should be added in the properties.xml to reduce performance issues for users:

traceEnabled="false" - this parameter the result set and sql query
traceJDBCEnabled="false

These should be set to false to avoid performance issues. This was raised as CLRT-62762 and resolved in v13.0

By default, these flags are set to True; if you encounter any performance related issues with regards to for example, the post timesheet jobs running slow etc. , the first thing you need to do is to set these flags to false (traceEnabled="false", traceJDBCEnabled="false" in Properties.xml)

However, if these values are set to "false" then tracing will not generate! Hence, to enable tracing you would need to either set both of these parameters to "true" or remove both parameters from properties.xml which requires a stop/restart of the Clarity services. Likewise, once the tracing has been completed you would need to stop the services, change the parameter values back to "false" or add the above values back into properties.xml, and then restart the Clarity services.

For more information on the configuration fields in this page, reference the CA PPM Installation Guide.

Additional Information:

The below video will demonstrate the steps to enable SQL trace for CA PPM Versions prior to 15.1

https://youtube.com//watch?v=0Ra2iQPciN0&index=59&list=PLynEdQRJawmyMiyiQOvtT1pBQuc_3oCZz