File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
-
2
1
/**
3
2
* !!! The hipchat-appender requires `hipchat-notifier` from npm
4
3
* - e.g. list as a dependency in your application's package.json
@@ -12,9 +11,12 @@ log4js.configure({
12
11
"type" : "hipchat" ,
13
12
"hipchat_token" : "< User token with Notification Privileges >" ,
14
13
"hipchat_room" : "< Room ID or Name >" ,
15
- // optionl
14
+ // optional
16
15
"hipchat_from" : "[ additional from label ]" ,
17
- "hipchat_notify" : "[ notify boolean to bug people ]"
16
+ "hipchat_notify" : "[ notify boolean to bug people ]" ,
17
8000
+ "hipchat_response_callback" : function ( err , response , body ) {
18
+ console . log ( "overridden log4js hipchat-appender response callback" ) ;
19
+ }
18
20
}
19
21
]
20
22
} ) ;
Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
+
2
3
var hipchat = require ( 'hipchat-notifier' ) ;
3
4
var layouts = require ( '../layouts' ) ;
4
5
@@ -44,6 +45,8 @@ function hipchatAppender(config, layout) {
44
45
// @lint W074 This function's cyclomatic complexity is too high. (10)
45
46
return function ( loggingEvent ) {
46
47
48
+ var notifierFn ;
49
+
47
50
notifier . setRoom ( config . hipchat_room ) ;
48
51
notifier . setRoom ( config . hipchat_room ) ;
49
52
notifier . setFrom ( config . hipchat_from || '' ) ;
@@ -53,11 +56,10 @@ function hipchatAppender(config, layout) {
53
56
notifier . setHost ( config . hipchat_host ) ;
54
57
}
55
58
56
- var notifierFn = "success" ;
57
59
switch ( loggingEvent . level . toString ( ) ) {
58
60
case "TRACE" :
59
61
case "DEBUG" :
60
- notifierFn = "notice " ;
62
+ notifierFn = "info " ;
61
63
break ;
62
64
case "WARN" :
63
65
notifierFn = "warning" ;
@@ -67,7 +69,7 @@ function hipchatAppender(config, layout) {
67
69
notifierFn = "failure" ;
68
70
break ;
69
71
default :
70
- notifierFn = "info " ;
72
+ notifierFn = "success " ;
71
73
}
72
74
73
75
// @TODO , re-work in timezoneOffset ?
You can’t perform that action at this time.
0 commit comments