EXPERIMENTAL Event SDK for Clients & Server implementations
Mojaloop Event SDK provides a simple API to log different kind of messages ( trace, log, error, audit ) and publish them to a central logging infrastructure.
The API is defined by the EventLogger
interface and the EventMessage
type. This library provides a default implementation DefaultEventLogger
which sends all the messages to a logging sidecar.
The logging behaviour can be modified as defined in the interfaces EventPreProcessor
and EventPostProcessor
which allow to use an EventLogger
that processes EventMessage
s before sending them and its response, respectively.
npm install @mojaloop/event-sdk
Import library:
import { DefaultEventLogger } from "../DefaultEventLogger"`
Create a Logger:
const logger = new DefaultEventLogger()`
Send an EventMessage
let result = await logger.log(event);