E.2 Examples of Custom Content Filter XML

This section provides examples of the Custom Content Filter XML.

E.2.1 Example One

The following Custom Content Filter causes all Java classes and all thread identifiers to be included in the trace log output. This filter traces everything. Care must be taken when using this filter because large amounts of data are logged, and the performance of the system degrades substantially.

<Trace flushFrequency="immediate"> <Classes> <Class>*</Class> </Classes> <Threads> <ThreadId>*</ThreadId> </Threads> </Trace>

E.2.2 Example Two

The following Custom Content Filter causes all Java classes, except com.novell.nidp.common.authority.ldap.jndi.JNDIUserStoreReplicaConnection, and all thread identifiers, to be included in the trace log output. The <Packages> subsection is not needed because this filter already includes all Java classes. Also including all Java packages would only be redundant.

<Trace flushFrequency="immediate"> <Classes> <Class>*</Class> <Class exclude="true">com.novell.nidp.common.authority.ldap.jndi.JNDIUse StoreReplicaConnection</Class> </Classes> <Threads> <ThreadId>*</ThreadId> </Threads> </Trace>

Specific Java classes can be excluded if irrelevant information is slowing down the log file. To determine how to filter out unwanted entries from the trace log content, perform the following steps:

  1. Locate the header for the entries that you want to exclude from the trace log.

    Each trace entry in the log file has a header that names the Java class where the trace entry originated. An example header is:

    NIDP TRACE LOG Method: com.novell.nidp.liberty.wsf.WSFFramework.initialize().

  2. Extract the Java class or Java package name from the header.

    In the above example, the Java class is

    com.novell.nidp.liberty.wsf.WSFFramework

    and the Java package is com.novell.nidp.liberty.wsf. The .initialize() method is inside the WSFFramework class. You do not need to extract the method name. You can ignore it.

  3. Add a <Class> or <Package> entry to the Custom Content Filter XML that excludes the Java class or Java package.

    Excluding the entire package removes trace log entries from other Java class files in the same package. Using the preceding example, if you want to exclude trace log entries from only the Java class com.novell.nidp.liberty.wsf.WSFFramework entry you would add

    <Class exclude="true">com.novell.nidp.liberty.wsf.WSFFramework</Class>

    to the <Classes> element subsection. If you want to exclude the entire package, you add

    <Package exclude="true">com.novell.nidp.liberty.wsf</Package>

    to the <Packages> element subsection.

    If you follow the preceding steps to exclude a Java class or package, and the trace log entry is still logged, this is because the log entry is being logged based on a thread identifier. Logs based on thread identifiers do not consider the Java class or package when deciding if the trace log should occur. In this case, determine which aspect of the product the trace log entry pertains to, and attempt to match it with a thread identifier. (Thread identifiers are explained in Section E.2.3, Example Three.) Then add a

    <ThreadId exclude="true">[thread id name]</ThreadId>

    line to the <Threads> subsection. Or, if you want to remove all trace logs associated with all thread identifiers, simply remove the <Threads> subsection.

E.2.3 Example Three

The following Custom Content Filter example includes all packages except for the explicitly excluded com.novell.nidp.common.authority.ldap package.

<Trace flushFrequency="immediate"> <Packages> <Package>*</Package> <Package exclude="true">com.novell.nidp.common.authority.ldap</Package> </Packages> <Threads> <ThreadId>*</ThreadId> <ThreadId exclude="true">tIdWSFSchemaExtensions</ThreadId> <ThreadId exclude="true">tIdRequestResponse</ThreadId> <ThreadId exclude="true">tIdConfiguration</ThreadId> <ThreadId exclude="true">tIdLdapJndiConnShare</ThreadId> <ThreadId exclude="true">tIdLdapJndiOperations</ThreadId> <ThreadId exclude="true">tIdLdapJndiOperationStats</ThreadId> <ThreadId exclude="true">tIdLdapJndiSearch</ThreadId> <ThreadId exclude="true">tIdLdapJndiGetObject</ThreadId> <ThreadId exclude="true">tIdLdapJndiModifyObject</ThreadId> <ThreadId exclude="true">tIdLdapJndiCreateConnection</ThreadId> <ThreadId exclude="true">tIdLdapJndiCloseConnection</ThreadId> <ThreadId exclude="true">tIdCBPing</ThreadId> <ThreadId exclude="true">tIdCBRetirement</ThreadId> <ThreadId exclude="true">tIdCBLogouts</ThreadId> <ThreadId exclude="true">tIdHealthCheck</ThreadId> </Threads> </Trace>

This example shows the filter for one of the most verbose packages. The example shows that you have chosen to exclude the LDAP package because the issue under investigation was not related to LDAP. This example goes on to include all thread identifiers, and then excludes each thread identifier. Thus, all thread identifiers are excluded by this filter. However, this example shows the complete list of thread identifiers. Therefore, using this filter would require you to only change exclude=“true” to exclude=“false” in order to include the relevant thread identifier.