Configuring the Policy logger service

Use this information to configure the policy logger service.

Table 1. Policy Logger Service configuration window

Window element

Description

Error-handling Policy

The error handling policy is the policy that is run by default when an error is not handled by an error handler within the policy where the error occurred.

Note: If you have a Policy Activator service and you want it to utilize a default exception handler policy, you must specify the following property in the <servername>_<activatorservicename>.props file: impact.<activatorservicename>. errorhandlername=<policy name to run>

Highest Log Level

You can specify a log level for messages that you print to the policy log from within a policy by using the Log function.

When a log() statement in a policy is processed, the specified log level is evaluated against the number that you select for this field. If the level specified in this field is greater than or equal to the level specified in the policy log() statement, the message is recorded in the policy log.

Warning: Setting Highest Log Level to 3 has the potential to cause a major load on the system, especially if you have the NOI Extensions installed. This can include 100% CPU usage. Log level should only be increased on a temporary basis and should be reverted to 0 when debug is complete.

Log what

Select what you want to appear in the log:

All SQL Statements / Policy Query Diagnostics checkbox
Logs all SQL statements and the number of data items that are returned by these policy queries: GetByFilter, GetByKey, DirectSQL. It also logs the increase of memory usage after the query was run. The memory change after the query does not necessarily provide an accurate picture of the memory that is used by the rows that are returned. Many other factors in the Netcool®/Impact JVM can contribute to increase and decrease of free memory. However, looking at several measurements over time for a query can give some insight into the memory usage of the data that is returned in the query.
Parameters for Built-in Functions checkbox
Logs the values of the parameters that are passed into each built-in Netcool/Impact function before and after the function execution. It also logs the DataItem and DataItems in the policy context before and after the function call. This feature also logs the number of rows and memory usage of the queries.
Local Variables on Exit of Custom Functions checkbox
Logs the values of local variables upon exit of a custom (user defined) function. For custom functions, it logs any variable that is defined locally in the function.
Full Current Context on Entry and Exit of Custom Functions checkbox
Logs the full context on entry and exit of all custom (user defined) functions. This approach is equivalent to calling Log(currentcontext()) just after entry and just before exit of the function, which can result in verbose logs.

Logging of DataItems or all variables in currentcontext(), displays the variable type after its value.

Warning: Setting anything in the Log what section has the potential to cause a major load on the system, especially if you have the NOI Extensions installed. This can include 100% CPU usage. Extra logging should only be enabled on a temporary basis and should be unselected when debug is complete.

Policy Profiling: Enable

Select to enable policy profiling. Policy profiling calculates the total time that it takes to run a policy and prints this time to the policy log

You can use this feature to see how long it takes to process variable assignments and functions. You can also see how long it takes to process an entire function and the entire policy.

Service log (Write to file)

Select to write log information to a file.

Append Thread Name to Log File Name

Select this option to name the log file by appending the name of the thread to the default log file name.

Append Policy Name to Log File Name

Select this option to name the log file by appending the name of the policy to the default log file name.

Collect Reports

Select to enable data collection for the Policy Reports.

If you choose to enable the Collect Reports option, reporting related logs are written to the policy logger file only when the log level is set to 3.

To see reporting related logs for a less detailed logging level for example, log level 1, the $IMPACT_HOME/etc/<servername>_policylogger.props file can be customized by completing the following steps:
  1. Add impact.policylogger.reportloglevel=1 to the $IMPACT_HOME/etc/<servername>_policylogger.props property.
  2. Restart the Impact Server to implement the change.