How to log APM messages to a custom file target


 Product(s):APM Implementation and Performance Management
 Version(s):N\A
 Environment:N\A
 Area:N/A
 Subarea:N\A

APM has extensive logging capability, with hundreds of logging categories. Most logging categories are not activated, for reasons of performance, disk utilization, as well as log file readability.

Should you need to add an additional logging category, for problem investigation, you may wish to log the messages to a log file separate from the default "file" target. This may simplify perusal of the log file.

Background

All things "logging" are accomplished from the APM Settings Editor. 

For Server, Thick-Client, APM Server Manager, and Remote instances, the Settings Editor is accessible from the APM Configuration utility, by way of the Configuration button's Full Settings option.

If running a Server instance in console mode, the Settings Editor is available on the APM Server dialog's Options menu, using the Server Settings menu option.

For a currently executing smart-client or thick-client, the Settings Editor is also available from the task tray's APM icon, by clicking with the right-mouse button, and selecting the Settings option.

You may want to have the smart-client, thick-client, and server instance setting readily available, without a running instance. To to this simply add the "-s" argument to an instance's shortcut.

Steps to Accomplish

  1. Open the Settings Editor for the instance for which a custom log target is required.
  2. In the Settings Editor window, select the Logging tab, and the Where to Log sub-tab.
  3. Select the New Target icon, and the New File Target option
  4. .A new "File - file" target will be added to the left-hand pane.
    1. Change the "name" for the new target, from "file" to something more meaningful.
    2. Change "fileName" to "${serverLogName}_xxxxxxxx.txt", replacing "xxxxxxxx" with a meaningful string (i.e., the log file name).
    3. Change "archiveFileName" to "${serverLogName}_xxxxxxxx.{#####}.txt", replacing "xxxxxxxx" with the same string used in the previous step.
    4. Change "archiveAboveSize", if a larger files size is required, mostly depending on the quantity of messages to be logged.
    5. Change "maxArchiveFiles", if more than 5 are required.
  5. For the logging categories to be logged to the new target, set "writeTo" to point to the new log target.


HINT: You can log to multiple targets. You may want to log to the new target, plus the "file" target. Logging to both allows perusal of the logged messages isolated to the new target, without the clutter of other logged messages. Logging to the "file" target allows you to see the logged messages mixed with all other "file" target messages, should you wish to also see the messages in context of other log categories.

See Also

Debugging Remote Synchronization problems

Debugging Report Design problems

Debugging ODC collection problems

Debugging problems with Checksheet Processing of Indicator Readings

Profile Database Query Performance

Investigating Performance of Site Views

 Original Author:roy suthers