bunyan-logzio
Simple Logz.io stream for Bunyan
This project was bootstrapped with @pizzahut-hut/create-typescript-package.
Installation
yarn i bunyan-logzio --save
Pre-requisites
Usage
import { createLogger } from 'browser-bunyan';
import LogzIOBunyanStream from 'bunyan-logzio';
const LOGZIO_ACCESS_TOKEN = 'my-logzio-access-token';
const logger = createLogger({
name: 'bunyan-logzio-example',
stream: [
...
{
name: 'logz.io',
stream: new LogzIOBunyanStream({accessToken: LOGZIO_ACCESS_TOKEN}),
level: 'info',
}
...
]
})
logger.info('hello world');
Note:
Depending on the project this is being used on, you can invoke the library two other ways:
import LogzIOBunyanStream from 'bunyan-logzio/legacy';
import LogzIOBunyanStream from 'bunyan-logzio/src';
Available Scripts
In the project directory, you can run:
yarn lint
Lints src and test files
yarn test
Launches the test runner, pass --watch
for interactive mode
yarn typecheck
Typecheck src and test files
yarn build
Compiles the package to lib
ready for publish
yarn eject
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.