Namespace: OpenEdge.Logging
Class
ConfigFileLoggerBuilder
Parent classes:
Inherits: OpenEdge.Logging.LoggerBuilder

Copyright (c) 2016-2017 by Progress Software Corporation. All rights reserved.
File:ConfigFileLoggerBuilder
Author(s):pjudge
Created:Mon Dec 05 09:48:11 EST 2016
Notes:* Assumes the config is stored in a JSON file
- named logging.config
- matching the schema in @DLC/src/corelib/OpenEdge/Logging/logging.config.schema
Any values set in this builder OVERRIDE the config values
https://logging.apache.org/log4j/1.2/manual.html .




Method Summary
Options Name Purpose
ClearConfig () /* Clears all the current logger configurations */
OpenEdge.Logging.LogLevelEnum FindLevel (character) /* Finds the log level for a logger to use, based on the logger type Algorithm is 1) exact match 2) chop off the trailing .-delimited entry, repeating 3) find the logger defined as DEFAULT_LOGGER, folling steps 1 & 2 @param character The logger type to find @return LogLevelEnum returns a log level , if any */
LOGICAL FindLogger (character, buffer) /* Find a temp-table record/config for a logger to use Algorithm is 1) exact match 2) chop off the trailing .-delimited entry, repeating 3) find the logger defined as DEFAULT_LOGGER, following steps 1 & 2 4) return a void logger (just to have a reference) @param character The logger type to find @param buffer A buffer reference to the logger temp-table @return logical TRUE if a logger record was found. If TRUE, the buffer will AVAILABLE; if false, not */
Progress.Lang.Class GetABLType (JsonObject, character) /* Returns a type name from a property we expect to have a type. Basically resolving the typeName / typeProperty values into an P.L.C "definitions": { "typeName": { "type": "string", "description": "An OOABL type name", "pattern": "^[A-Za-z]+[A-Za-z$0-9-&#%.]+[A-Za-z$0-9-&#%]*$" }, "typeProperty": { "type": "object", "properties": { "type": {"$ref": "#/definitions/typeName"}, "hash": { "type": "string", "description": "A hash value to validate that the OOABL type is the expected version." } }, "required": ["type"] }, "builderProperty": { "oneOf": [ {"$ref": "#/definitions/typeProperty"}, {"$ref": "#/definitions/typeName"} ] } }, @param JsonObject The JSON containign the type property @param character The name of the propert @return P.L.Class A resolve ABL type name. May be unknown */
OpenEdge.Logging.ILogWriter GetLoggerInstance () /* Constructs the actual logger instance @return ILogWriter A new or cached logged */
LoadConfig (JsonObject) /* Loads logging configuration from JSON @param JsonObject JSON representation of the lgging configuration */
ValidateFilter (character, character) /* Ensures that a Filter type is the one we were expecting. @param character (mandatory) The ABL Filter name used to process the event @param character (optional) A hash used to verify the Filter's authenticity @throws AppError If a hash is passed and the Filter type's hash does not match */

Constructor Summary
Options Name Purpose
ConfigFileLoggerBuilder () /* Static constructor */
ConfigFileLoggerBuilder (character) /* Constructor @param character The logger type being built */

Property Summary
Options Name Purpose
OpenEdge.Core.Util.BuilderRegistry FilterBuilders /** Registry for mapping builder types to their implementations This is the registry of LogFilterBuilders and not the registry of log writers. */
OpenEdge.Core.Util.BuilderRegistry Filters


Method Detail
Top

ClearConfig ()

/* Clears all the current logger configurations
Top

OpenEdge.Logging.LogLevelEnum FindLevel (character)

/* Finds the log level for a logger to use, based on the logger type
Algorithm is
1) exact match
2) chop off the trailing .-delimited entry, repeating
3) find the logger defined as DEFAULT_LOGGER, folling steps 1 & 2
Parameters:
pcLoggerType CHARACTER
Returns OpenEdge.Logging.LogLevelEnum
LogLevelEnum returns a log level , if any
Top

LOGICAL FindLogger (character, buffer)

/* Find a temp-table record/config for a logger to use
Algorithm is
1) exact match
2) chop off the trailing .-delimited entry, repeating
3) find the logger defined as DEFAULT_LOGGER, following steps 1 & 2
4) return a void logger (just to have a reference)
buffer will AVAILABLE; if false, not
Parameters:
pcLoggerType CHARACTER
pbLogger buffer
Returns LOGICAL
logical TRUE if a logger record was found. If TRUE, the
Top

Progress.Lang.Class GetABLType (JsonObject, character)

/* Returns a type name from a property we expect to have a type. Basically resolving the
typeName / typeProperty values into an P.L.C
"definitions": {
"typeName": {
"type": "string",
"description": "An OOABL type name",
"pattern": "^[A-Za-z]+[A-Za-z$0-9-&#%.]+[A-Za-z$0-9-&#%]*$"
},
"typeProperty": {
"type": "object",
"properties": {
"type": {"$ref": "#/definitions/typeName"},
"hash": {
"type": "string",
"description": "A hash value to validate that the OOABL type is the expected version."
}
},
"required": ["type"]
},
"builderProperty": {
"oneOf": [
{"$ref": "#/definitions/typeProperty"},
{"$ref": "#/definitions/typeName"}
]
}
},
Parameters:
poParent Progress.Json.ObjectModel.JsonObject
pcPropName CHARACTER
Returns Progress.Lang.Class
P.L.Class A resolve ABL type name. May be unknown
Top

OpenEdge.Logging.ILogWriter GetLoggerInstance ()

/* Constructs the actual logger instance
Returns OpenEdge.Logging.ILogWriter
ILogWriter A new or cached logged
Top

LoadConfig (JsonObject)

/* Loads logging configuration from JSON
Parameters:
poJson Progress.Json.ObjectModel.JsonObject
Top

ValidateFilter (character, character)

/* Ensures that a Filter type is the one we were expecting.
@throws AppError If a hash is passed and the Filter type's hash does not match
Parameters:
pcFilterType CHARACTER
pcFilterHash CHARACTER


Constructor Detail
Top

STATIC ConfigFileLoggerBuilder ()

/* Static constructor
Top

ConfigFileLoggerBuilder (character)

/* Constructor
Parameters:
pcLoggerType CHARACTER


Property Detail
Top

OpenEdge.Core.Util.BuilderRegistry FilterBuilders

Purpose: Registry for mapping builder types to their implementations
This is the registry of LogFilterBuilders and not the registry of
log writers.
Returns OpenEdge.Core.Util.BuilderRegistry
Top

OpenEdge.Core.Util.BuilderRegistry Filters

Returns OpenEdge.Core.Util.BuilderRegistry


Copyright © 2017 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 11.7