Package com.amazonaws.log
Class InternalLogFactory
- java.lang.Object
-
- com.amazonaws.log.InternalLogFactory
-
- Direct Known Subclasses:
CommonsLogFactory
,JulLogFactory
@ThreadSafe public abstract class InternalLogFactory extends Object
Can be used to configure the default log factory for the AWSJavaClientCore and AWSJavaClientSigners. Default to JUL, unless AWSJavaClientRuntime is present which will default it to Jakarta Commons Logging.
-
-
Constructor Summary
Constructors Constructor Description InternalLogFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static boolean
configureFactory(InternalLogFactory factory)
Used to explicitly configure the log factory.protected abstract InternalLogApi
doGetLog(Class<?> clazz)
SPI to return a logger given a class.protected abstract InternalLogApi
doGetLog(String name)
SPI to return a logger given a name.static InternalLogFactory
getFactory()
Returns the current default log factory.static InternalLogApi
getLog(Class<?> clazz)
Returns an SDK logger that logs using the currently configured default log factory, given the class.static InternalLogApi
getLog(String name)
Returns an SDK logger that logs using the currently configured default log factory, given the name.
-
-
-
Method Detail
-
getLog
public static InternalLogApi getLog(Class<?> clazz)
Returns an SDK logger that logs using the currently configured default log factory, given the class.
-
getLog
public static InternalLogApi getLog(String name)
Returns an SDK logger that logs using the currently configured default log factory, given the name.
-
doGetLog
protected abstract InternalLogApi doGetLog(Class<?> clazz)
SPI to return a logger given a class.
-
doGetLog
protected abstract InternalLogApi doGetLog(String name)
SPI to return a logger given a name.
-
getFactory
public static InternalLogFactory getFactory()
Returns the current default log factory.
-
configureFactory
public static boolean configureFactory(InternalLogFactory factory)
Used to explicitly configure the log factory. The log factory can only be configured at most once. All subsequent configurations will have no effect. Note explicitly configuring the log factory will have positive performance impact on all subsequent logging, since the specific logger can be directly referenced instead of being searched every time.- Parameters:
factory
- the log factory to be used internally by the SDK- Returns:
- true if the log factory is successfully configured; false otherwise (ie the log factory is not allowed to be configured more than once for performance reasons.)
-
-