Registering for trace

Use the registerApplication() method to specify the application to register with application trace.

The method is of the form:
int registerApplication(String application_name, String[] format_template)

The application_name argument is the name of the application you want to trace. The name must be the same as the application name you specify at JVM startup. The format_template argument is an array of format strings like the strings used by the printf method. You can specify templates of up to 16 KB. The position in the array determines the tracepoint identifier (starting at 0). You can use these identifiers to enable specific tracepoints at run time. The first character of each template is a digit that identifies the type of tracepoint. The tracepoint type can be one of entry, exit, event, exception, or exception exit. After the tracepoint type character, the template has a blank character, followed by the format string.

The trace types are defined as static values within the Trace class:
public static final String EVENT= "0 ";
public static final String EXCEPTION= "1 ";
public static final String ENTRY= "2 ";
public static final String EXIT= "4 ";
public static final String EXCEPTION_EXIT= "5 ";

The registerApplication() method returns an integer value. Use this value in subsequent trace() calls. If the registerApplication() method call fails for any reason, the value returned is -1.