example now works
This commit is contained in:
parent
ad7e844d68
commit
e49f7107fb
15
example.js
15
example.js
@ -1,6 +1,19 @@
|
|||||||
var log4js = require('./lib/log4js');
|
var log4js = require('./lib/log4js');
|
||||||
//log the cheese logger messages to a file, and the console ones as well.
|
//log the cheese logger messages to a file, and the console ones as well.
|
||||||
log4js.addAppender(log4js.fileAppender('cheese.log'), 'cheese', 'console');
|
log4js.configure({
|
||||||
|
appenders: [
|
||||||
|
{
|
||||||
|
type: "file",
|
||||||
|
filename: "cheese.log",
|
||||||
|
categories: [ 'cheese','console' ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "console"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
replaceConsole: true
|
||||||
|
});
|
||||||
|
//log4js.addAppender(log4js.fileAppender('cheese.log'), 'cheese', 'console');
|
||||||
|
|
||||||
var logger = log4js.getLogger('cheese');
|
var logger = log4js.getLogger('cheese');
|
||||||
//only errors and above get logged.
|
//only errors and above get logged.
|
||||||
|
Loading…
Reference in New Issue
Block a user