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 classFormatter producing logs in the pattern:yyyy-MM-dd HH:mm:ss.SSS [thread] LEVEL logger - message -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinit()Initialize logging if not already configured.static voidInitialize logging with the supplied date pattern if not already configured.static voiduseUniformFormatter(Handler handler) Set theLoggingConfig.UniformFormatteron 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.UniformFormatteron the supplied handler.- Parameters:
handler- the handler to configure
-