# LoggerEntryContent

**Kind:** Interface

**Source:** [`packages/microservices/external/kafka.interface.ts`](https://github.com/nestjs/nest/blob/master/packages/microservices/external/kafka.interface.ts#L633)

**Part of:** [Microservices](subsystem-packages-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

```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.
