Interface: LoggingOptions
@providerprotocol/agents / index / LoggingOptions
Interface: LoggingOptions
Section titled “Interface: LoggingOptions”Defined in: src/middleware/types.ts:216
Configuration options for the logging middleware.
logging for the middleware factory function
Example
Section titled “Example”// Minimal loggingconst options: LoggingOptions = { level: 'warn',};
// Verbose debug logging to custom destinationconst debugOptions: LoggingOptions = { level: 'debug', includeMessages: true, includeTiming: true, logger: (msg) => myLogger.log(msg),};Properties
Section titled “Properties”includeMessages?
Section titled “includeMessages?”
optionalincludeMessages: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.
Default Value
Section titled “Default Value”falseincludeTiming?
Section titled “includeTiming?”
optionalincludeTiming: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.
Default Value
Section titled “Default Value”truelevel?
Section titled “level?”
optionallevel:"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 informationinfo- General execution informationwarn- Warning conditionserror- Error conditions only
Default Value
Section titled “Default Value”'info'logger()?
Section titled “logger()?”
optionallogger: (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).
Parameters
Section titled “Parameters”message
Section titled “message”string
The formatted log message including level prefix
Returns
Section titled “Returns”void
Default Value
Section titled “Default Value”console.logExample
Section titled “Example”logger: (msg) => winston.info(msg)