bs-winston-cloudwatch

Winston Cloudwatch Transport for ReasonML

Usage no npm install needed!

<script type="module">
  import bsWinstonCloudwatch from 'https://cdn.skypack.dev/bs-winston-cloudwatch';
</script>

README

npm

BsWinstonCloudwatch

Adapter of winston-cloudwatch winston transport plugin for ReasonML. Used with BsWinston.

Install

npm install bs-winston-cloudwatch

And to bsconfig.json: "bs-dependencies": [..., "bs-winston-cloudwatch", ...]

bs-winston must naturally be installed also.

Examples

let (cloudwatchTransport, kthxbyeFn) = BsWinstonCloudwatch.Transport.createCloudwatch(
  ~logGroupName = "xxxx",
  ~logStreamName = "yyyy",
);

let logger = Builder.create()
  -> Builder.addTransport(cloudwatchTransport)
  -> Builder.build;

/*  ... after logging done, flush and close:  */
kthxbye()
|> Js.Promise.then_(() => { ... });