Logging level

Use this information to learn about trace levels when you are logging information to the Cúram server and to learn how to use trace options.

When you are logging to the Cúram server, trace level needs to be considered. These settings can be used to guard the calls that are made into log4j to improve the performance in environments where tracing is not required1.

To check the current trace level setting, call the curam.util.resources.Trace.atLeast(Trace t) method, where the parameter to the method can be one of the following options:

  • curam.util.resources.Trace.kTraceOff
  • curam.util.resources.Trace.kTraceOn
  • curam.util.resources.Trace.kTraceVerbose
  • curam.util.resources.Trace.kTraceUltraVerbose

To specify the trace level for the application, set the curam.trace property, as defined in Cúram Configuration Settings to one of the following values:

  • trace_on (corresponds to O in Table 1)
  • trace_verbose (corresponds to V in Table 1)
  • trace_ultra_verbose (corresponds to U in Table 1)

The following code sample demonstrates how the amount of logging information that is output by your application code depends on the current trace level that is configured in the application:

Figure 1. Logging example in application code
if (curam.util.resources.Trace.atLeast(
                     curam.util.resources.Trace.kTraceOn)) {
    curam.util.resources.Trace.kTopLevelLogger.info(
      "hello world.");
}

Each trace option causes significant information to be written to the log file, and can have a significant impact on the performance of the application. The following table shows how the value of the curam.trace property determines the trace level by causing corresponding trace properties to be enabled.

Table 1. Diagnostic tracing options

Trace property name

Description

curam.trace property value

curam.trace.servercalls

Trace server method invocations by remote clients. This information includes the name of the user who is requesting the invocation.

O

curam.trace.methods

Trace all business object method invocation.

V

curam.trace.method_args

Memory dump arguments, including their types, to business object method invocations.

U

curam.trace.sql

Trace SQL statements run by entity objects.

V

curam.trace.sql_args

Memory dump results of SQL select statements.

U

curam.trace.rules

Enables logging of rules

U

curam.trace.smtp

Trace the messages that are sent to the mail server.

 
1 While log4j imposes a minimal memory allocation, it cannot avoid the cost of the parameter construction inside the method invocation. Application developers must take this operation into consideration.