loglevel-plugin-server
Plugin for sending logs to the remote server
Installation
> npm install loglevel-plugin-server --save
Usage
;
Parameters
loglevel
- the root logger, imported from loglevel package
options
- plugin config object
options parameter | type | description | default value |
---|---|---|---|
url | string | url to log server | http://localhost:8080/log |
callOriginal | boolean | true | call original loglevel method (console.log) |
level | string | trace | loglevel level (trace, debug, info, warn, error). See loglevel documentation |
format | function | see below | function for formatting message before sending to the server |
Default format function
const format = { return JSON;};
ES6 usage example
;; const options = url: 'http://localhost:8080/';;loglevel;
License
This software is distributed under an MIT licence.
Copyright 2017 © Zoreslav Goral