8000 example now works · rboss/log4js-node@e49f710 · GitHub
[go: up one dir, main page]

Skip to content

Commit e49f710

Browse files
author
Gareth Jones
committed
example now works
1 parent ad7e844 commit e49f710

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

example.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
var log4js = require('./lib/log4js');
22
//log the cheese logger messages to a file, and the console ones as well.
3-
log4js.addAppender(log4js.fileAppender('cheese.log'), 'cheese', 'console');
3+
log4js.configure({
4+
appenders: [
5+
{
6+
type: "file",
7+
filename: "cheese.log",
8+
categories: [ 'cheese','console' ]
9+
},
10+
{
11+
type: "console"
12+
}
13+
],
14+
replaceConsole: true
15+
});
16+
//log4js.addAppender(log4js.fileAppender('cheese.log'), 'cheese', 'console');
417

518
var logger = log4js.getLogger('cheese');
619
//only errors and above get logged.

0 commit comments

Comments
 (0)
0