added initial configuration

This commit is contained in:
Gareth Jones
2013-08-22 08:44:36 +10:00
parent bdb56e4256
commit 270ba0fcc6
2 changed files with 41 additions and 13 deletions

View File

@@ -20,18 +20,21 @@
* <h3>Example:</h3>
* <pre>
* var logging = require('log4js');
* //add an appender that logs all messages to stdout.
* logging.addAppender(logging.consoleAppender());
* //add an appender that logs "some-category" to a file
* logging.addAppender(logging.fileAppender("file.log"), "some-category");
* logging.configure({
* appenders: {
* "errorFile": { type: "file", filename: "error.log" }
* },
* categories: {
* "default": { level: "ERROR", appenders: [ "errorFile" ] }
* }
* });
* //get a logger
* var log = logging.getLogger("some-category");
* log.setLevel(logging.levels.TRACE); //set the Level
*
* ...
*
* //call the log
* log.trace("trace me" );
* log.error("oh noes");
* </pre>
*
* NOTE: the authors below are the original browser-based log4js authors
@@ -286,11 +289,6 @@ function restoreConsole() {
*/
module.exports = {
getLogger: getLogger,
/*
addAppender: addAppender,
loadAppender: loadAppender,
clearAppenders: clearAppenders,
*/
configure: configure,
/*
replaceConsole: replaceConsole,
@@ -306,6 +304,6 @@ module.exports = {
};
//set ourselves up
//debug("Starting configuration");
//configure();
debug("Starting configuration");
configure(defaultConfig);