In your component definition (.hda) file, add the following:
... to the ResourceDefinition table
resource
resources/custom_resources.htm
customTraceSections
500
... to the MergeRules table:
customTraceSections
IdcTracingSections
itsSection
1
... to the resource file defined above (ie. custom_resources.htm):
<@table customTraceSections@>
<table border="1"><caption><strong>Custom Tracing Sections</strong></caption>
<tr>
<td>itsSection</td>
<td>itsDescription</td>
<td>itsDefaultEnabled</td>
</tr>
<tr>
<td>customTraceName</td>
<td>trace custom component</td>
<td>false</td>
</tr>
</table>
<@end@>
Then change either of the following to suit your needs:
- "customTraceName" to the name you want to use for your tracing section. This is what appears within the tracing section dropdown list.
- itsDefaultEnabled to "true" if you want your tracing section to be active/turned on after restarting the content server.
At this point, your tracing section is set up and ready to be used by your java code (after restart).
First, be sure to include the SystemUtils class:
import intradoc.common.SystemUtils;
Then simply add tracing like this:
SystemUtils.trace("customTraceName", "Thanks stellentpmp!");
or like this if you want to utilize "Full Verbose Tracing":
if (SystemUtils.m_verbose)
{
SystemUtils.trace("customTraceName", "Thanks stellentpmp for everything!");
}
Good luck.
No comments:
Post a Comment