Guidelines

Parro Nexus development guidelines

Logging

  • ALL logging should include at least the trace-id from the requests which is processed.
  • Every controller handling Incoming messages MUST log the request as first action
  • Incoming messages are logged on INFO level
  • Incoming messages are logged with prefix [INCOMING]
  • Every service sending or publishing a request MUST add a log line
  • Outgoing messages are logged on INFO level
  • Outgoing message are logged with prefix [OUTGOING]
  • Query logging is always TRACE level
  • Durations must NOT be logged but added to a metric

examples:

logWithContext(this.logger).withObj(rMessage, 'message').info('[INCOMING] Message request');
logWithContext(this.logger).info(`[OUTGOING] Publish message to ${ConnectPubSubSubjects.MESSAGE_V1_INGEST} subject`);