Share via


ILogger interface

Custom logger interface for Agent 365 observability Implement this interface to support logging backends

Methods

error(string, unknown[])

Log an error message

event(ExporterEventNames, boolean, number, string, Record<string, string>)

Log an event with standardized parameters

info(string, unknown[])

Log an informational message

warn(string, unknown[])

Log a warning message

Method Details

error(string, unknown[])

Log an error message

function error(message: string, args: unknown[])

Parameters

message

string

The log message

args

unknown[]

Optional arguments to include in the log

event(ExporterEventNames, boolean, number, string, Record<string, string>)

Log an event with standardized parameters

function event(eventType: ExporterEventNames, isSuccess: boolean, durationMs: number, message?: string, details?: Record<string, string>)

Parameters

eventType
ExporterEventNames

Standardized event name from ExporterEventNames enum (e.g., ExporterEventNames.EXPORT)

isSuccess

boolean

Whether the operation/event succeeded

durationMs

number

Duration of the operation/event in milliseconds

message

string

Optional message or additional details about the event, especially useful for errors or failures

details

Record<string, string>

Optional key-value pairs with additional context (e.g., correlationId, tenantId, agentId, etc.)

info(string, unknown[])

Log an informational message

function info(message: string, args: unknown[])

Parameters

message

string

The log message

args

unknown[]

Optional arguments to include in the log

warn(string, unknown[])

Log a warning message

function warn(message: string, args: unknown[])

Parameters

message

string

The log message

args

unknown[]

Optional arguments to include in the log