Class EnhancedPropertyConverter

All Implemented Interfaces:
ContextAware, LifeCycle

public class EnhancedPropertyConverter extends ClassicConverter
Variation of the Logback PropertyConverter with the option to specify a default value to use when the property does not exist instead of returning null as does the original Logback implementation.

The default value is optional and can be specified using the :- operator as in Bash shell. For example, assuming the property "foo" is not defined, %property{foo:-bar} will return bar. If no optional value is declared, the converter returns an empty string instead of null if the property is not defined.

The property resolution mechanism is the same as the Logback implementation. The property is first looked up in the context associated with the logging event. If not found, the property is searched in the System environment.

Author:
brenuart