ILogger interface

Interfaccia del logger personalizzata per l'osservabilità di Agent 365 Implementare questa interfaccia per supportare i back-end di registrazione

Metodi

error(string, unknown[])

Registrare un messaggio di errore

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

Registrare un evento con parametri standardizzati

info(string, unknown[])

Registrare un messaggio informativo

warn(string, unknown[])

Registrare un messaggio di avviso

Dettagli metodo

error(string, unknown[])

Registrare un messaggio di errore

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

Parametri

message

string

Messaggio di log

args

unknown[]

Argomenti facoltativi da includere nel log

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

Registrare un evento con parametri standardizzati

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

Parametri

eventType
ExporterEventNames

Nome evento standardizzato dall'enumerazione ExporterEventNames (ad esempio, ExporterEventNames.EXPORT)

isSuccess

boolean

Indica se l'operazione/l'evento è riuscito

durationMs

number

Durata dell'operazione/evento in millisecondi

message

string

Messaggio facoltativo o dettagli aggiuntivi sull'evento, particolarmente utile per errori o errori

details

Record<string, string>

Coppie chiave-valore facoltative con contesto aggiuntivo (ad esempio, correlationId, tenantId, agentId e così via)

info(string, unknown[])

Registrare un messaggio informativo

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

Parametri

message

string

Messaggio di log

args

unknown[]

Argomenti facoltativi da includere nel log

warn(string, unknown[])

Registrare un messaggio di avviso

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

Parametri

message

string

Messaggio di log

args

unknown[]

Argomenti facoltativi da includere nel log