9 6 14 Use Logging Services

LANSA Composer

9.6.14 Use Logging Services

The DXACTBAS1 ancestor class implements the Logger property. Through the methods of the logger, your Activity Processor can manage its output to the log for the Processing Sequence.

Nesting Level

The NestAdd and NestSub methods of the logger control the nesting level of the log entries. The nesting level is used as a visual cue when displaying the log entries to indicate the relative hierarchy of the processing steps.

Every call to NestAdd should be matched by a later call to NestSub. It is your responsibility to ensure your program code adheres to this requirement for all possible code paths.

In most cases it is unnecessary for your Activity Processor to call these methods. The Processing Sequence engine manages the nesting level to reflect the structure of the Processing Sequence. However, if the processing in your Activity Processors is particularly structured and you need to reflect that in your log output, you can call these methods.

Write Log Entries

The Processing Sequence log is held at two levels of detail.

Summary log entries are typically used to indicate completion of major processing steps and are intended for routine operational monitoring. You can create summary log entries as required using the following methods of the logger:

  • LogUserComp (completion )
  • LogUserDiag (diagnostic)
  • LogUserError (error)
  • LogUserExtra (subsidiary log text)
  • LogUserInfo (information)
  • LogUserWarn (warning)

Detail log entries are typically used to provide deeper diagnostic information and are intended for problem diagnosis and resolution. You can create detail log entries as required using the following methods of the logger:

  • LogTechComp (completion )
  • LogTechDiag (diagnostic)
  • LogTechError (error)
  • LogTechExtra (subsidiary log text)
  • LogTechInfo (information)
  • LogTechWarn (warning)