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
| Property | Type |
|---|---|
timestamp | string |
message | string |
Diagram
mermaidgraph 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
tsimport 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
timestampas a consistently formatted string; prefernew Date().toISOString(). - Keep
messageconcise, descriptive, and useful for debugging or operational monitoring. - Do not add undeclared fields when a Kafka consumer expects the
LoggerEntryContentcontract. - Serialize the interface payload appropriately before publishing it to Kafka or another transport layer.
Was this page helpful?