Class ClockFactory
java.lang.Object
org.apache.logging.log4j.core.util.ClockFactory
Factory for
Clock objects.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StatusLoggerstatic final StringName of the system property that can be used to specify aClockimplementation class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaliases()private static Clockstatic ClockgetClock()Returns aClockinstance depending on the value of system propertyPROPERTY_NAME.private static ClocklogSupportedPrecision(Clock clock)
-
Field Details
-
PROPERTY_NAME
Name of the system property that can be used to specify aClockimplementation class. The value of this property is "log4j.Clock".- See Also:
-
LOGGER
-
-
Constructor Details
-
ClockFactory
private ClockFactory()
-
-
Method Details
-
getClock
Returns aClockinstance depending on the value of system propertyPROPERTY_NAME.If system property
log4j.Clock=CachedClockis specified, this method returns an instance ofCachedClock. If system propertylog4j.Clock=CoarseCachedClockis specified, this method returns an instance ofCoarseCachedClock.If another value is specified, this value is taken as the fully qualified class name of a class that implements the
Clockinterface. An object of this class is instantiated and returned.If no value is specified, or if the specified value could not correctly be instantiated or did not implement the
Clockinterface, then an instance ofSystemClockis returned.- Returns:
- a
Clockinstance
-
aliases
-
createClock
-
logSupportedPrecision
-