example now works

This commit is contained in:
Gareth Jones 2012-06-29 09:01:42 +10:00
parent ad7e844d68
commit e49f7107fb

View File

@ -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.