Troubleshooting
Problem
Details on TeamWorks log4j settings including instructions on how to set log levels and other aspects of the TeamWorks logging.
Resolving The Problem
- Logging in TeamWorks is managed by log4j; further information on log4j background is available at the Apache site.
- debug
- info
- warn
- error
- fatal
In TeamWorks, logging is controlled by various log4j.xml files, some of which can be found for example, in the Resources directory of both the Process and Performance Servers.
Let's explain some of the entries with a view to seeing which parameters would need to be modified to alter the log levels. It would be good practice to always keep a backup in hand, of the current (working) log4j.xml should you need to revert.
In the log4j specification, as you can see, the available logging detail levels are:
Appenders do the actual writing.
- You should not need to modify the values in the appender tags. These do not control what is written to the logs, rather at what threshold that particular appender listens. You typically want to leave these at their default values. We are not aware of any runtime performance gain by tuning or altering these. Instead you should alter the values within the category tags to error (or fatal).
- The names of the category are either class names or package names (note that the names are actually arbitrary, but we have named them based on the class or package that they log for as defined in the corresponding appender). If they fall within the package, they get picked up by that category. The logging "starts" at the category, then is passed to the appender. In practice this means you can leave the appenders always at their default and just change the log level(s) of the categories.Be careful that you don't have a category at DEBUG and an appender at ERROR. This would have almost the same performance penalty as having the Category and Appender both at DEBUG as it still "passes" the logging to the appender.In a Production environment we would recommend changing the log levels to error unless you really don't want to see anything in the logs, in which case you would set it to fatal.
- Let's suppose you are having problems with a failing import into TeamWorks and need to generate more verbose logs to help determine the root cause. In the log4j.xml above, the Appender is already set DEBUG, but looking at the category entry we can see this:
- <category name="twexpimp" additivity="false">
<priority value="info"/>
<appender-ref ref="TWExportImport"/>
</category>
- Log4j includes a built in smtp appender. With almost no effort, you can have log4j send you emails.
First create an appender like the example below:
- <appender name="SupportEmailer" class="org.apache.log4j.net.SMTPAppender">
- <param name="BufferSize" value="512" />
<param name="SMTPHost" value="smtp.MyDomain.com" />
<param name="From" value="log4j@MyDomain.com" />
<param name="To" value="MyAdmin@MyDomain.com" />
<param name="Subject" value="I fell over and can't get up..." />
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="[%d{ISO8601}]%n%n%-5p%n%n%c%n%n%m%n%n" />
<filter class="org.apache.log4j.varia.LevelRangeFilter">
- <param name="LevelMin" value="ERROR"/>
<param name="LevelMax" value="FATAL"/>
- <category name="com.lombardisoftware" additivity="false">
- <priority value="error"/>
<appender-ref ref="TWDynamicAppender"/>
<appender-ref ref="TWDebugAppender"/>
<appender-ref ref="TWInfoAppender"/>
<appender-ref ref="TWWarnAppender"/>
<appender-ref ref="TWErrorAppender"/>
<appender-ref ref="SupportEmailer"/>
- If you wish to add to or modify the log files available to view in the drop down list of the TeamWorks Console, you need to locate and modify the 50AppServer.xml property file which in the case of the Process Server can be found in /teamworks/process-server/resources/config/system
Find the section like this:
- <!--This defines where the LogWatch screen finds it logs. The logs are setup relative to the-->
<log-watcher>
- <log name="TW Access Log" file-name="./logs/tw-access.log"/>
<log name="TW Console Log" file-name="./logs/tw.log"/>
<log name="TW Debug Log" file-name="./logs/tw-debug.log"/>
<log name="TW Error Log" file-name="./logs/tw-error.log"/>
<log name="TW Exp/Imp Log" file-name="./logs/tw-expimp.log"/>
<log name="TW Limit" file-name="./logs/tw-limit.log"/>
<log name="TW Javascript" file-name="./logs/tw-javascript.log"/>
<log name="Process Timing Log" file-name="./logs/tw-process-timing.log"/>
<log name="TW Trace Log" file-name="./logs/tw-trace.log"/>
<log name="WS Inbound Log" file-name="./logs/tw-inbound_webservices.log"/>
<log name="WS Outbound Log" file-name="./logs/tw-outbound_webservices.log"/>
- You can also adjust the log level for the Eclipse based Authoring Environment - refer to this technote
for details of the log4j.xml file location and changes required.
[{"Product":{"code":"SSFPRP","label":"WebSphere Lombardi Edition"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.2;7.1;7.0.1;6.2.2;6.2.1;6.2;6.1;6.0.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Historical Number
187
Product Synonym
TW Teamworks
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21439659