2011-07-13 16:12:29 +08:00
|
|
|
var log4js = require('./lib/log4js');
|
2011-04-07 08:19:18 +08:00
|
|
|
log4js.addAppender(log4js.fileAppender('cheese.log'), 'cheese');
|
|
|
|
|
2011-07-13 16:12:29 +08:00
|
|
|
var logger = log4js.getLogger('cheese');
|
2011-04-07 08:19:18 +08:00
|
|
|
logger.setLevel('INFO');
|
|
|
|
|
|
|
|
var app = require('express').createServer();
|
|
|
|
app.configure(function() {
|
|
|
|
app.use(log4js.connectLogger(logger, { level: log4js.levels.INFO }));
|
|
|
|
});
|
|
|
|
app.get('/', function(req,res) {
|
|
|
|
res.send('hello world');
|
|
|
|
});
|
|
|
|
app.listen(5000);
|