log4js-node-xmpp

A log4js-node log appender to send logging events using XMPP protocol.

npm install log4js-node-xmpp
4 downloads in the last week
8 downloads in the last month

log4js-node-xmpp Build Status

A log4js-node log appender to send logging events using XMPP protocol.

Installation

npm install log4js-node-xmpp

Usage

Please use it as other log4js-node appenders. It needs host, jid and password at least.

var log4js = require('log4js'),
    xmpp = require('log4js-node-xmpp'),
    logger = log4js.getLogger('hello');

log4js.addAppender(xmpp.configure({
    client: {
        host: 'talk.google.com',
        jid: '<username>',
        password: '<password>'
    },

    to: '<to address>'
}), 'hello');

logger.info('Hello World');

Or you can use the configure method.

var log4js = require('log4js'),
    logger = log4js.getLogger('hello');

log4js.configure({
    appenders: [
        {
            type: 'console'
        },

        {
            "type": "xmpp",
            "category": "hello",

            "client": {
                "host": "talk.google.com",
                "jid": "<username>",
                "password": "<password>"
            },

            "to": "<to address>"
        }
    ]
});
logger.info('Hello World');
npm loves you