Class Table Of Contents

- All Classes
- All Files
- API
  - comb
    - logging
      - PropertyConfigurator
      - Level
      - BasicConfigurator
      - Logger
      - appenders
        - RollingFileAppender
        - ConsoleAppender
        - Appender
        - FileAppender
        - JSONAppender
    - PromiseList
    - Promise
    - regexp
    - array
    - string
    - collections
      - Pool
      - Iterable
      - HashTable
      - MaxHeap
      - Heap
      - Stack
      - AVLTree
      - AnderssonTree
      - Collection
      - RedBlackTree
      - Tree
      - Queue
      - BinaryTree
      - PriorityQueue
      - MinHeap
    - plugins
      - Middleware
      - Broadcaster
    - number
    - characters
    - date
- comb.logging.PropertyConfigurator
- Methods
  - configure

# Class comb.logging.PropertyConfigurator

Extends comb.logging.BasicConfigurator.
Configures comb.Logger with the properties or properties contained within a file
Defined in: config.js.

Class Detail
comb.logging.PropertyConfigurator()

#### Example 1 :

    var propertyConfigurator = new comb.logging.PropertyConfigurator();

    propertyConfigurator.configure("/location/of/combLogger.json");

    //or

    var config = {
        "my.logger" : {
            level : "INFO",
            appenders : [
                {
                    //default file appender
                    type : "FileAppender",
                    file : "/var/log/myApp.log",
                },
                {
                    //default JSON appender
                    type : "JSONAppender",
                    file : "/var/log/myApp.JSON",
                },
                {
                    type : "FileAppender",
                     //override default patter
                    pattern : "{[EEEE, MMMM dd, yyyy h:m a]timeStamp} {[5]level}"
                             + " {[- 5]levelName} {[-20]name} : {message}",
                    //location of my log file
                    file : "/var/log/myApp-errors.log",
                    //override name so it will get added to the log
                    name : "errorFileAppender",
                    //overwrite each time
                    overwrite : true,
                    //explicity set the appender to only accept errors
                    level : "ERROR"
                },
                {
                    type : "JSONAppender",
                    file : "/var/log/myApp-error.json",
                    //explicity set the appender to only accept errors
                    level : "ERROR"
                }
            ]
        }
        //repeat for more loggers

        propertyConfigurator.configure(config);
    }

Method Detail
configure(properties)
Call to configure logging

#### Example 1 :

    //Example configuration
     {
        "my.logger" : {
            level : "INFO",
            appenders : [
                {
                    //default file appender
                    type : "FileAppender",
                    file : "/var/log/myApp.log",
                },
                {
                    //default JSON appender
                    type : "JSONAppender",
                    file : "/var/log/myApp.JSON",
                },
                {
                    type : "FileAppender",
                     //override default patter
                    pattern : "{[EEEE, MMMM dd, yyyy h:m a]timeStamp} {[5]level}"
                             + " {[- 5]levelName} {[-20]name} : {message}",
                    //location of my log file
                    file : "/var/log/myApp-errors.log",
                    //override name so it will get added to the log
                    name : "errorFileAppender",
                    //overwrite each time
                    overwrite : true,
                    //explicity set the appender to only accept errors
                    level : "ERROR"
                },
                {
                    type : "JSONAppender",
                    file : "/var/log/myApp-error.json",
                    //explicity set the appender to only accept errors
                    level : "ERROR"
                }
            ]
        }

Parameters:
{Object|String} properties
  Object containing configuration or string containing a file name with the configuration.

    var rootLogger = Logger.getRootLogger();
    rootLogger.removeAllAppenders();
    if (base.isHash(properties)) {
        parseProperties(properties);
    } else {
        fs.readFile(properties, function (err, res) {
            if (err) {
                throw err;
            } else {
                try {
                    parseProperties(JSON.parse(res));
                } catch (e) {
                    throw e;
                }
            }
        });
    }

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jan 31 2012 16:14:12 GMT-0600 (CST)