Class DefaultPropertiesLoader
- java.lang.Object
-
- com.ppm.logging.configuration.DefaultPropertiesLoader
-
- All Implemented Interfaces:
PropertiesLoader
public class DefaultPropertiesLoader extends Object implements PropertiesLoader
Default Configuration Properties Loader- Author:
- pedrotoliveira
-
-
Constructor Summary
Constructors Constructor Description DefaultPropertiesLoader()DefaultPropertiesLoader(Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetConsoleIgnoreExceptions()Should Console Logging Ignore Exceptions?org.apache.logging.log4j.LevelgetConsoleLevel()Get Console Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OFF - Custom log levels will be disabled at this project moment.List<String>getConsolePackages()Get a List of Packages to configure the Log Hierarchy.StringgetConsolePatternLayout()Gets Console Pattern Layout.StringgetConsoleTarget()Output Stream for Console Logger. Can be Either "SYSTEM_OUT" or "SYSTEM_ERR".BooleangetCreateFileOnDemand()Get the Create File On Demand property.BooleangetFileAppend()Get the file append property.org.apache.logging.log4j.LevelgetFileLevel()Get File Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OFF - Custom log levels will be disabled at this project moment.List<String>getFilePackages()Get a List of Packages to configure the Log Hierarchy.StringgetFilePattern()Get the file archiving pattern.StringgetFilePatternLayout()Gets File Pattern Layout.org.apache.logging.log4j.LevelgetRemoteLevel()Get Remote Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OFF - Custom log levels will be disabled at this project moment.List<String>getRemotePackages()Get a List of Packages to configure the Log Hierarchy.StringgetRemotePatternLayout()Gets Remote Pattern Layout.org.apache.logging.log4j.LevelgetRootLevel()Get Root Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OF - Custom log levels will be disabled at this project moment.BooleanisConsoleEnabled()It Should console logging be enabled?BooleanisFileEnabled()It Should console logging be enabled?BooleanisRemoteEnabled()It Should Remote logging be enabled?-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ppm.logging.configuration.PropertiesLoader
get
-
-
-
-
Constructor Detail
-
DefaultPropertiesLoader
public DefaultPropertiesLoader()
-
DefaultPropertiesLoader
public DefaultPropertiesLoader(Properties properties)
-
-
Method Detail
-
getRootLevel
public org.apache.logging.log4j.Level getRootLevel()
Description copied from interface:PropertiesLoaderGet Root Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OF - Custom log levels will be disabled at this project moment.- Specified by:
getRootLevelin interfacePropertiesLoader- Returns:
- an Event Level.
- See Also:
- log4j/2.0/manual/architecture.html
-
isConsoleEnabled
public Boolean isConsoleEnabled()
Description copied from interface:PropertiesLoaderIt Should console logging be enabled?- Specified by:
isConsoleEnabledin interfacePropertiesLoader- Returns:
- true or false
-
getConsoleLevel
public org.apache.logging.log4j.Level getConsoleLevel()
Description copied from interface:PropertiesLoaderGet Console Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OFF - Custom log levels will be disabled at this project moment.- Specified by:
getConsoleLevelin interfacePropertiesLoader- Returns:
- an Event Level.
- See Also:
- log4j/2.0/manual/architecture.html
-
getConsolePackages
public List<String> getConsolePackages()
Description copied from interface:PropertiesLoaderGet a List of Packages to configure the Log Hierarchy.By default The logger engine will consider the same pattern from log4j. For example, the LoggerConfig named "com.foo" is a parent of the LoggerConfig named "com.foo.Bar". Similarly,"java" is a parent of "java.util" and an ancestor of "java.util.Vector". This naming scheme should be familiar to most developers.
- Specified by:
getConsolePackagesin interfacePropertiesLoader- Returns:
- a List of String representing packages Namespaces
- See Also:
- log4j/2.x/manual/architecture.html
-
getConsolePatternLayout
public String getConsolePatternLayout()
Description copied from interface:PropertiesLoaderGets Console Pattern Layout.More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a Layout with an Appender. The Layout is responsible for formatting the LogEvent according to the user's wishes, whereas an appender takes care of sending the formatted output to its destination.
- Specified by:
getConsolePatternLayoutin interfacePropertiesLoader- Returns:
- a Pattern Layout String
- See Also:
- log4j/2.x/manual/layouts.html
-
getConsoleIgnoreExceptions
public String getConsoleIgnoreExceptions()
Description copied from interface:PropertiesLoaderShould Console Logging Ignore Exceptions?The default is true, causing exceptions encountered while appending events to be internally logged and then ignored. When set to false exceptions will be propagated to the caller, instead. You must set this to false when wrapping this Appender in a FailoverAppender.
- Specified by:
getConsoleIgnoreExceptionsin interfacePropertiesLoader- Returns:
- Return a String "true" or "false" values, if you return something different from "true" or "false" the DefaultConfigurationFactory will consider as "true".
-
getConsoleTarget
public String getConsoleTarget()
Description copied from interface:PropertiesLoaderOutput Stream for Console Logger. Can be Either "SYSTEM_OUT" or "SYSTEM_ERR". The default is "SYSTEM_OUT".- Specified by:
getConsoleTargetin interfacePropertiesLoader- Returns:
- a String
-
isFileEnabled
public Boolean isFileEnabled()
Description copied from interface:PropertiesLoaderIt Should console logging be enabled?- Specified by:
isFileEnabledin interfacePropertiesLoader- Returns:
- true or false
-
getFileLevel
public org.apache.logging.log4j.Level getFileLevel()
Description copied from interface:PropertiesLoaderGet File Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OFF - Custom log levels will be disabled at this project moment.- Specified by:
getFileLevelin interfacePropertiesLoader- Returns:
- an Event Level.
- See Also:
- log4j/2.0/manual/architecture.html
-
getFilePackages
public List<String> getFilePackages()
Description copied from interface:PropertiesLoaderGet a List of Packages to configure the Log Hierarchy.By default The logger engine will consider the same pattern from log4j. For example, the LoggerConfig named "com.foo" is a parent of the LoggerConfig named "com.foo.Bar". Similarly,"java" is a parent of "java.util" and an ancestor of "java.util.Vector". This naming scheme should be familiar to most developers.
- Specified by:
getFilePackagesin interfacePropertiesLoader- Returns:
- a List of String representing packages Namespaces
- See Also:
- log4j/2.x/manual/architecture.html
-
getFilePatternLayout
public String getFilePatternLayout()
Description copied from interface:PropertiesLoaderGets File Pattern Layout.More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a Layout with an Appender. The Layout is responsible for formatting the LogEvent according to the user's wishes, whereas an appender takes care of sending the formatted output to its destination.
- Specified by:
getFilePatternLayoutin interfacePropertiesLoader- Returns:
- a Pattern Layout String
- See Also:
- log4j/2.x/manual/layouts.html
-
getFileAppend
public Boolean getFileAppend()
Description copied from interface:PropertiesLoaderGet the file append property.When true - the default, records will be appended to the end of the file. When set to false, the file will be cleared before new records are written.
- Specified by:
getFileAppendin interfacePropertiesLoader- Returns:
- true or false
-
getCreateFileOnDemand
public Boolean getCreateFileOnDemand()
Description copied from interface:PropertiesLoaderGet the Create File On Demand property.The appender creates the file on-demand. The appender only creates the file when a log event passes all filters and is routed to this appender. Defaults to false.
- Specified by:
getCreateFileOnDemandin interfacePropertiesLoader- Returns:
- true or false
-
getFilePattern
public String getFilePattern()
Description copied from interface:PropertiesLoaderGet the file archiving pattern.The pattern of the file name of the archived log file Example: .yyyy-MM-dd This pattern will depends on file systems grow policies.
- Specified by:
getFilePatternin interfacePropertiesLoader- Returns:
- a String representing the pattern
-
isRemoteEnabled
public Boolean isRemoteEnabled()
Description copied from interface:PropertiesLoaderIt Should Remote logging be enabled?- Specified by:
isRemoteEnabledin interfacePropertiesLoader- Returns:
- true or false
-
getRemoteLevel
public org.apache.logging.log4j.Level getRemoteLevel()
Description copied from interface:PropertiesLoaderGet Remote Log Level It can be: ALL TRACE DEBUG INFO WARN ERROR FATAL OFF - Custom log levels will be disabled at this project moment.- Specified by:
getRemoteLevelin interfacePropertiesLoader- Returns:
- an Event Level.
- See Also:
- log4j/2.0/manual/architecture.html
-
getRemotePackages
public List<String> getRemotePackages()
Description copied from interface:PropertiesLoaderGet a List of Packages to configure the Log Hierarchy. By default The logger engine will consider the same pattern from log4j. For example, the LoggerConfig named "com.foo" is a parent of the LoggerConfig named "com.foo.Bar". Similarly,"java" is a parent of "java.util" and an ancestor of "java.util.Vector". This naming scheme should be familiar to most developers.- Specified by:
getRemotePackagesin interfacePropertiesLoader- Returns:
- a List of String representing packages Namespaces
- See Also:
- log4j/2.x/manual/architecture.html
-
getRemotePatternLayout
public String getRemotePatternLayout()
Description copied from interface:PropertiesLoaderGets Remote Pattern Layout.More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a Layout with an Appender. The Layout is responsible for formatting the LogEvent according to the user's wishes, whereas an appender takes care of sending the formatted output to its destination.
- Specified by:
getRemotePatternLayoutin interfacePropertiesLoader- Returns:
- a Pattern Layout String
- See Also:
- log4j/2.x/manual/layouts.html
-
-