Module org.glassfish.main.jul
Package org.glassfish.main.jul.formatter
Class FormatterConfigurationHelper
java.lang.Object
org.glassfish.main.jul.cfg.ConfigurationHelper
org.glassfish.main.jul.formatter.FormatterConfigurationHelper
This is a tool to help with parsing the logging.properties file to configure formatters.
It respects JUL configuration standards, so ie. each formatter knows best how to configure itself, but still can use this helper to parse properties directly to objects instead of plain strings.
Helper also supports custom error handlers.
- Author:
- David Matejcek
-
Nested Class Summary
Nested classes/interfaces inherited from class org.glassfish.main.jul.cfg.ConfigurationHelper
ConfigurationHelper.LoggingPropertyErrorHandler -
Field Summary
Fields inherited from class org.glassfish.main.jul.cfg.ConfigurationHelper
ERROR_HANDLER_PRINT_TO_STDERR -
Constructor Summary
ConstructorsConstructorDescriptionFormatterConfigurationHelper(String prefix, ConfigurationHelper.LoggingPropertyErrorHandler errorHandler) -
Method Summary
Modifier and TypeMethodDescriptionstatic FormatterConfigurationHelperforFormatterClass(Class<? extends Formatter> formatterClass) Creates helper for parsing formatter settings using formatter class name as a prefix.static FormatterConfigurationHelperforHandlerId(HandlerId handlerId) Creates helper for parsing formatter settings using the handler's formatter attribute.Methods inherited from class org.glassfish.main.jul.cfg.ConfigurationHelper
getBoolean, getCharacter, getCharset, getDateTimeFormatter, getFile, getInteger, getLevel, getList, getNonNegativeInteger, getString, handleError, parse, parseOrSupply
-
Constructor Details
-
FormatterConfigurationHelper
public FormatterConfigurationHelper(String prefix, ConfigurationHelper.LoggingPropertyErrorHandler errorHandler) - Parameters:
prefix- Usually a canonical class nameerrorHandler-
-
-
Method Details
-
forHandlerId
Creates helper for parsing formatter settings using the handler's formatter attribute.- Parameters:
handlerId-- Returns:
- instance of the helper which prints errors to the standard error output.
-
forFormatterClass
public static FormatterConfigurationHelper forFormatterClass(Class<? extends Formatter> formatterClass) Creates helper for parsing formatter settings using formatter class name as a prefix.- Parameters:
formatterClass-- Returns:
- instance of the helper which prints errors to the standard error output.
-