Class Index | File Index

## Classes

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

# 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 Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| comb.logging.PropertyConfigurator()

Method Summary
Method Attributes | Method Name and Description
--- | ---
| configure(properties) Call to configure logging

Class Detail
comb.logging.PropertyConfigurator()

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

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 13:20:07 GMT-0500 (CDT)