Package com.cedarsoftware.util
Class LoggingConfig
java.lang.Object
com.cedarsoftware.util.LoggingConfig
Configures java.util.logging to use a uniform log format similar to
popular frameworks like SLF4J/Logback.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Formatter producing logs in the pattern:yyyy-MM-dd HH:mm:ss.SSS [thread] LEVEL logger - message
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
init()
Initialize logging if not already configured.static void
Initialize logging with the supplied date pattern if not already configured.static void
useUniformFormatter
(Handler handler) Set theLoggingConfig.UniformFormatter
on the supplied handler.
-
Method Details
-
init
public static void init()Initialize logging if not already configured. The formatter pattern can be set via system property "ju.log.dateFormat" or by callinginit(String)
. -
init
Initialize logging with the supplied date pattern if not already configured.- Parameters:
datePattern
- pattern passed toSafeSimpleDateFormat
-
useUniformFormatter
Set theLoggingConfig.UniformFormatter
on the supplied handler.- Parameters:
handler
- the handler to configure
-