Skip to content

Interface: LoggingOptions

@providerprotocol/agents


@providerprotocol/agents / index / LoggingOptions

Defined in: src/middleware/types.ts:216

Configuration options for the logging middleware.

logging for the middleware factory function

// Minimal logging
const options: LoggingOptions = {
level: 'warn',
};
// Verbose debug logging to custom destination
const debugOptions: LoggingOptions = {
level: 'debug',
includeMessages: true,
includeTiming: true,
logger: (msg) => myLogger.log(msg),
};

optional includeMessages: boolean

Defined in: src/middleware/types.ts:254

Whether to include message content in debug logs.

When enabled, logs the input message content and response text. Useful for debugging but may expose sensitive data.

false

optional includeTiming: boolean

Defined in: src/middleware/types.ts:263

Whether to include execution timing in log output.

When enabled, logs the duration of agent execution in milliseconds.

true

optional level: "error" | "info" | "debug" | "warn"

Defined in: src/middleware/types.ts:228

Minimum log level to output.

Messages below this level are suppressed. Levels in order of verbosity:

  • debug - Detailed debugging information
  • info - General execution information
  • warn - Warning conditions
  • error - Error conditions only
'info'

optional logger: (message) => void

Defined in: src/middleware/types.ts:244

Custom logging function to receive log messages.

Override this to integrate with your logging infrastructure (e.g., Winston, Pino, or a cloud logging service).

string

The formatted log message including level prefix

void

console.log
logger: (msg) => winston.info(msg)