💾 bunyan-mssql-streamer
Exports logs from bunyan logger to MS SQL. See docs about bunyan streams for details.
This library wil be used in conjunction with restify's requestLogger and auditLogger to log Errors and Requests/Responses to MS SQL.
Install
> yarn add bunyan-mssql-streamer
Usage
There are 3 steps of setup
// 1. create bunyan logger as usual; // 2. create MS SQL Logger; // 3. add logger stream to root loggerrootLogger.addStream;
You may add as many streams as you need. They will use single connection pool to DB.
[1]: see tediousjs/node-mssql for MS SQL configs
[2]: specify mapping as "table column name": "log record path spec"
.
If path spec begins with $
, it will be treated as JSON path.
You may also use a function as source field in mapping. That function will receive log record as first argument.
Dev workflows
Run tests
Fast tests
> yarn unittest
Slow tests
> yarn integtest
All tests
> yarn test
Release new version
> yarn release
This command will
- increment version in
package.json
- generate
CHANGELOG.md
- commit that chages with tag
See standard-version for details.
Publish to NPM
> npm publish