Skip to content
Browse files

close #8 implement log4js configuration

- add log4js config path with -c option.
- add default log4js.json
- document added for log4js.json
  • Loading branch information...
1 parent 1498e9b commit 6652e02b92551bcd13a7bdf566af8fb6cb5ed20b @yssk22 committed Jun 2, 2011
Showing with 35 additions and 1 deletion.
  1. +11 −0 conf/log4js.json
  2. +21 −0 doc/source/ref/conf.rst
  3. +3 −1 lib/boot.js
View
11 conf/log4js.json
@@ -0,0 +1,11 @@
+{
+ "appenders": [
+ {
+ "type": "logLevelFilter",
+ "level": "DEBUG",
+ "appender": {
+ "type": "console"
+ }
+ }
+ ]
+}
View
21 doc/source/ref/conf.rst
@@ -90,3 +90,24 @@ The defaults are:
}
}
+
+log4js.json
+-------------------------------------------------------------------------------
+
+`log4js <https://github.com/csausdev/log4js-node>`_ configuration file.
+
+The defaults are:
+
+::
+
+ {
+ "appenders": [
+ {
+ "type": "logLevelFilter",
+ "level": "DEBUG",
+ "appender": {
+ "type": "console"
+ }
+ }
+ ]
+ }
View
4 lib/boot.js
@@ -8,7 +8,9 @@ var createSite = require('./site').createSite;
module.exports = function(dir){
var options = merge({}, require('optimist').argv);
if( options.c ){
- config.load(abspath(options.c));
+ var configpath = abspath(options.c);
+ config.load(configpath);
+ require('./utils').logConfigure(null, null, [configpath].concat(require.paths));
}
if( options.a ){
options.a = !Array.isArray(options.a) ? [options.a] : options.a;

0 comments on commit 6652e02

Please sign in to comment.
Something went wrong with that request. Please try again.