1.0.2 • Published 5 years ago

bunyan-influx v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

bunyan-influx

A Bunyan stream for saving logs into InfluxDB

import bunyanInflux from "bunyan-influx";
import * as bunyan from "bunyan";

const stream = await bunyanInflux.GetStream({
                        database: "applog",
                        host: "localhost",
                        schema: [
                        {
                            fields: {
                                jsonString: bunyanInflux.InfluxTypes.STRING
                            },
                            measurement: "logs",
                            tags: ["level"]
                        }
                        ]
                    });

const log = bunyan.createLogger({
  name: "my-applog",
  stream: stream
});

log.info({ jsonString: JSON.stringify({ message: "My json string" }) });
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago