diff --git a/examples/hipchat-appender.js b/examples/hipchat-appender.js index 7b8b3db..c0e90e4 100644 --- a/examples/hipchat-appender.js +++ b/examples/hipchat-appender.js @@ -1,18 +1,20 @@ -//Note that hipchat appender needs hipchat-client to work. -//If you haven't got hipchat-client installed, you'll get cryptic -//"cannot find module" errors when using the hipchat appender + +/** + * !!! The hipchat-appender requires `hipchat-notifier` from npm + * - e.g. list as a dependency in your application's package.json + */ + var log4js = require('../lib/log4js'); log4js.configure({ "appenders": [ { "type" : "hipchat", - "api_key": 'Hipchat_API_V1_Key', - "room_id": "Room_ID", - "from": "Tester", - "format": "text", - "notify": "NOTIFY", - "category" : "hipchat" + "hipchat_token": "< User token with Notification Privileges >", + "hipchat_room": "< Room ID or Name >", + // optionl + "hipchat_from": "[ additional from label ]", + "hipchat_notify": "[ notify boolean to bug people ]" } ] }); @@ -25,4 +27,4 @@ logger.trace("Test Trace Message");//so debug and trace are the same color: purp logger.fatal("Test Fatal Message");//hipchat client has limited color scheme logger.error("Test Error Message");// fatal and error are same color: red logger.all("Test All message");//grey -//logger.debug("Test log message"); \ No newline at end of file +//logger.debug("Test log message"); diff --git a/lib/appenders/hipchat.js b/lib/appenders/hipchat.js index 9a5e95c..17afc65 100644 --- a/lib/appenders/hipchat.js +++ b/lib/appenders/hipchat.js @@ -8,6 +8,7 @@ exports.configure = hipchatConfigure; /** @invoke as + log4js.configure({ "appenders": [ { @@ -21,6 +22,10 @@ exports.configure = hipchatConfigure; } ] }); + + var logger = log4js.getLogger("hipchat"); + logger.warn("Test Warn message"); + @invoke */