Home

Awesome

Plugin for JS logger loglevel which will forward all log messages to the server

Features

Installation

Configuration

Add loglevel and loglevel-serverSend scripts to your page first. Then configure the plugin:

##loglevelServerSend(logger, options) Extend loglevel with new plugin which will send log information to the log-sever

ParamTypeDescription
logger<code>object</code>loglevel instance to be extended
options<code>object</code>
[options.url=<code>'http://localhost:8000/main/log&#x27;</code>]<code>string</code>Server url which would be used as a log server
[options.prefix=<code>null</code>]<code>string</code> | <code>function</code>Prefix for all log messages. Either string or function wich should return string and accept log severity and message as parameters
[options.callOriginal=<code>false</code>]<code>Bool</code>If set to true - original loglevel method for logging would be called

Example

loglevelServerSend(log,{url:'https://example.com/app/log',prefix: function(logSev,message) {
    return '[' + new Date().toISOString() + '] ' + logSev + ': ' + message + '\n'   
}})

Servers

It should be fairly easy to create a server which will store all the log messages, but most probably node-log-server would be good enough for you