8000 update hipchat-appender example · JJediny/log4js-node@6131934 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 6131934

Browse files
committed
update hipchat-appender example
1 parent 4ab05a5 commit 6131934

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

examples/hipchat-appender.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
//Note that hipchat appender needs hipchat-client to work.
2-
//If you haven't got hipchat-client installed, you'll get cryptic
3-
//"cannot find module" errors when using the hipchat appender
1+
2+
/**
3+
* !!! The hipchat-appender requires `hipchat-notifier` from npm
4+
* - e.g. list as a dependency in your application's package.json
5+
*/
6+
47
var log4js = require('../lib/log4js');
58

69
log4js.configure({
710
"appenders": [
811
{
912
"type" : "hipchat",
10-
"api_key": 'Hipchat_API_V1_Key',
11-
"room_id": "Room_ID",
12-
"from": "Tester",
13-
"format": "text",
14-
"notify": "NOTIFY",
15-
"category" : "hipchat"
13+
"hipchat_token": "< User token with Notification Privileges >",
14+
"hipchat_room": "< Room ID or Name >",
15+
// optionl
16+
"hipchat_from": "[ additional from label ]",
17+
"hipchat_notify": "[ notify boolean to bug people ]"
1618
}
1719
]
1820
});
@@ -25,4 +27,4 @@ logger.trace("Test Trace Message");//so debug and trace are the same color: purp
2527
logger.fatal("Test Fatal Message");//hipchat client has limited color scheme
2628
logger.error("Test Error Message");// fatal and error are same color: red
2729
logger.all("Test All message");//grey
28-
//logger.debug("Test log message");
30+
//logger.debug("Test log message");

lib/appenders/hipchat.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ exports.configure = hipchatConfigure;
88

99
/**
1010
@invoke as
11+
1112
log4js.configure({
1213
"appenders": [
1314
{
@@ -21,6 +22,10 @@ exports.configure = hipchatConfigure;
2122
}
2223
]
2324
});
25+
26+
var logger = log4js.getLogger("hipchat");
27+
logger.warn("Test Warn message");
28+
2429
@invoke
2530
*/
2631

0 commit comments

Comments
 (0)
0