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 Details

    • InternalLogFactory

      public InternalLogFactory()
  • Method Details

    • 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.)