Class comb.logging.PropertyConfigurator
Extends
comb.logging.BasicConfigurator.
Configures comb.Logger with the properties or properties contained within a file
Defined in: config.js.
Constructor Attributes | Constructor Name and Description |
---|---|
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.