https://github.com/deployable/node-deployable-log
Node logging shim to setup named pino and debug loggers for apps
https://github.com/deployable/node-deployable-log
deployable log logger nodejs npm-module pino
Last synced: 6 months ago
JSON representation
Node logging shim to setup named pino and debug loggers for apps
- Host: GitHub
- URL: https://github.com/deployable/node-deployable-log
- Owner: deployable
- License: mit
- Created: 2017-01-18T05:20:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T00:05:13.000Z (over 7 years ago)
- Last Synced: 2024-12-06T09:15:43.969Z (10 months ago)
- Topics: deployable, log, logger, nodejs, npm-module, pino
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [@deployable/log](https://github.com/deployable/node-deployable-log)
Deployable Logging, [pino](https://github.com/pinojs/pino) and [debug](https://github.com/visionmedia/debug).
### Install
npm install @deployable/log --saveyarn add @deployable/log
### Usage
```javascript
const { logger, debug } = require('@deployable/log').fetch('dply:tag')
logger.info('testing')
debug('testing') // Requires `DEBUG` to be set in the environment```
#### Express Logger
Supports attaching the logger to express with express-pino-logger.
```javascript
const { logger, debug } = require('@deployable/log').fetch('dply:express')
const app = require('express')()
app.use(logger.express())```
### Test Usage
Setting the `NODE_ENV` environment variable to `test` will cause the pino logger
to store output in the ringbuffer rather than it's normal output.Get the last log from the buffer as an object:
Log.testGetLastLog()
Get all logs in the buffer, as objects:
Log.testGetAllLogs()
### License
deployable-log is released under the MIT license.
Copyright 2016 Matt Hoyle - Deployable Ltdhttps://github.com/deployable/node-deployable-log