Skip to content

LoggerEntryContent

reference
1 min readUpdated

Kind: Interface

Source: packages/microservices/external/kafka.interface.ts

Part of: Microservices

LoggerEntryContent defines the core payload stored for a log entry in the Kafka microservices integration. It pairs a timestamp with a human-readable message, providing a consistent structure for log serialization, transport, and consumption.

Properties

PropertyType
timestampstring
messagestring

Diagram

mermaid
graph LR
  A[Application Event] --> B[LoggerEntryContent]
  B --> C[timestamp: string]
  B --> D[message: string]
  B --> E[Kafka Log Message]
  E --> F[Log Consumer / Monitoring]

Usage

ts
import type { LoggerEntryContent } from './kafka.interface';

const logEntry: LoggerEntryContent = {
  timestamp: new Date().toISOString(),
  message: 'Kafka consumer connected successfully',
};

// Use as the content of a Kafka logging payload.
console.log(JSON.stringify(logEntry));

AI Coding Instructions

  • Always provide timestamp as a consistently formatted string; prefer new Date().toISOString().
  • Keep message concise, descriptive, and useful for debugging or operational monitoring.
  • Do not add undeclared fields when a Kafka consumer expects the LoggerEntryContent contract.
  • Serialize the interface payload appropriately before publishing it to Kafka or another transport layer.

Was this page helpful?

Download as PDF
LoggerEntryContent — NestJS head-to-head