Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tswayne/cee-logger
Node Cee logger using winston
https://github.com/tswayne/cee-logger
Last synced: about 1 month ago
JSON representation
Node Cee logger using winston
- Host: GitHub
- URL: https://github.com/tswayne/cee-logger
- Owner: tswayne
- Created: 2016-07-29T17:44:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T03:23:03.000Z (over 6 years ago)
- Last Synced: 2024-09-05T09:42:13.646Z (2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cee Logger using winston
This is a custom formatter for winston logger to produce logs in cee format## Usage
```javascript
const log = require('cee-logger');
const logger = log.setupLogger({name: 'my-project'});
logger.info('A plain message'); // @cee: {"severity":"INFO","name":"my-project","host":"local","pid":10234,"msg":"A plain message"}
logger.log('emerg', 'Uh oh'); // @cee: {"severity":"EMERG","name":"my-project","host":"local","pid":10234,"msg":"Uh oh"}
logger.info({ data: 'valid JSON' }); // @cee: {"severity":"INFO","name":"my-project","host":"local","pid":10234,"data":"valid JSON"}
logger.info('This gets saved to a "msg" field', { data: 'valid JSON' }); // @cee: {"severity":"INFO","name":"my-project","host":"local","pid":10234,"data":"valid JSON","msg":"This gets saved to a \"msg\" field"}
logger.crit('All levels specified below work'); // @cee: {"severity":"CRIT","name":"my-project","host":"local","pid":10234,"msg":"All levels specified below work"}
```For more information on winston see https://github.com/winstonjs/winston
## Development
Feel free to create issues or pull requests for extending the potential default logged items.