0 votes
849 views
in Best Practices by

1 Answer

0 votes
ago by (30.6k points)

Logging options in a process application, from built-in to custom:

  • log.info / log.debug / log.error in server-side scripts - goes to SystemOut.log of the member (BAW: also the WLE trace loggers); free, always there, but mixed with the server log. Prefix messages with app acronym and instance id.
  • Activity / step logging in the engine: Process Admin > instance details, the execution tree and the Process Inspector record every step with timestamps - the audit trail of the flow itself; no code needed.
  • Instance comments (the comments API of the instance, REST or JavaScript) - human-readable notes attached to the instance, visible in the portal; good for business-relevant events ("credit check overridden by X").
  • Tracking groups - structured business events into the Performance Data Warehouse (and BAI on CP4BA); the right place for "what happened when" analytics, not for debugging.
  • Custom log table - a toolkit service that inserts (timestamp, app, instance, step, level, message, user) into your own table; queryable, retention under your control; the most common enterprise choice.
  • Java logging framework (log4j / java.util.logging in a managed jar) - files per app with rotation (question 1022); on CP4BA write to stdout instead and let the platform collect.
  • Central log shipping - SystemOut / stdout to ELK / Splunk / OpenShift logging; combine with a JSON log line format from your log service so that dashboards can filter by instance id.
  • Browser side - console.log in coach views for development; an "audit" Service Call for user actions worth keeping.
// toolkit service flow "Log" (level, message) - script writing a structured line to SystemOut / stdout
var line = JSON.stringify({ ts: new Date().toISOString(), app: tw.system.model.processApp.acronym, piid: tw.system.currentProcessInstanceID, user: tw.system.user.name, level: tw.local.level, msg: tw.local.message });
if (tw.local.level == "ERROR") log.error(line); else log.info(line);

Guideline: the engine's own history + tracking groups cover most needs; add one custom log service for technical diagnostics with a level switch in an EPV; never log personal data or secrets; keep logs out of the BPMDB (no custom tables in it).

References

Related questions

0 votes
1 answer 2.4k views
+1 vote
2 answers 6.5k views
0 votes
1 answer 1.9k views
+1 vote
2 answers 7.4k views
+1 vote
1 answer 1.8k views
0 votes
1 answer 1.1k views
0 votes
2 answers 4.0k views
0 votes
1 answer 2.7k views
0 votes
1 answer 3.1k views
0 votes
1 answer 975 views
0 votes
1 answer 2.1k views
0 votes
1 answer 816 views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...