Class EventLoggerFactory

java.lang.Object
com.illumon.iris.db.util.logging.EventLoggerFactory

public class EventLoggerFactory
extends Object
Class to create audit and process event log loggers, and provide a mechanism to create and initialize other binary loggers. This is primarily a wrapper around IntradayLoggerBuilder.
  • Constructor Summary

    Constructors 
    Constructor Description
    EventLoggerFactory()  
  • Method Summary

    Modifier and Type Method Description
    static AuditEventLogFormat2Logger createAuditEventLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, boolean forceUseLas, String timeZoneName)
    Create and initialize an audit event log.
    static <T extends com.illumon.intradaylogger.IntradayLogger>
    T
    createIntradayLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, Class<T> loggerClass, String timeZoneName)
    Create an Intraday logger using the namespace and table name from the schema.
    static <T extends com.illumon.intradaylogger.IntradayLogger>
    T
    createIntradayLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, Class<T> loggerClass, String timeZoneName, String columnPartitionValue)
    Create an Intraday logger using the namespace and table name from the schema, using the specified column partition value.
    static <T extends com.illumon.intradaylogger.IntradayLogger,​ U>
    T
    createIntradayLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, Class<T> loggerClass, String timeZoneName, Function<U,​String> columnPartitionFunction)
    Create an Intraday logger using the namespace and table name from the schema.
    static <T extends com.illumon.intradaylogger.IntradayLogger,​ U>
    T
    createIntradayLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, Class<T> loggerClass, String timeZoneName, Function<U,​String> columnPartitionFunction, boolean forceUseLas)
    Create an Intraday logger using the namespace and table name from the schema.
    static <T extends com.illumon.intradaylogger.IntradayLogger,​ U>
    T
    createIntradayLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, String namespace, String tableName, Class<T> loggerClass, String timeZoneName, Function<U,​String> columnPartitionFunction, boolean forceUseLas)
    Create an Intraday logger.
    static ProcessEventLogFormat2Logger createProcessEventLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, boolean forceUseLas, String timeZoneName)
    Create and initialize a process event log.
    static ProcessInfoFormat1Logger createProcessInfoLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, boolean forceUseLas, String timeZoneName)
    Create and initialize a process info log.
    static ProcessMetricsFormat1Logger createProcessMetricsLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, boolean forceUseLas, String timeZoneName)
    Create and initialize a process metrics log.
    static AuditEventLogFormat2Logger createStandaloneAuditEventLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, boolean forceUseLas, String timeZoneName)
    Create and initialize an audit event log, and don't verify the logger checksum.
    static <T extends com.illumon.intradaylogger.IntradayLogger,​ U>
    T
    createStandaloneIntradayLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, Class<T> loggerClass, String timeZoneName, Function<U,​String> columnPartitionFunction, boolean forceUseLas)
    Create a standalone (does not verify checksum) Intraday logger using the namespace and table name from the generated logger.
    static ProcessEventLogFormat2Logger createStandaloneProcessEventLogger​(com.fishlib.configuration.Configuration configuration, String processName, com.fishlib.io.logger.Logger log, boolean forceUseLas, String timeZoneName)
    Create and initialize a process event log, and don't verify the logger checksum.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • createAuditEventLogger

      public static AuditEventLogFormat2Logger createAuditEventLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, boolean forceUseLas, @Nullable String timeZoneName)
      Create and initialize an audit event log.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      forceUseLas - if true, always use the LogAggregatorService
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized AuditEventLogFormat2Logger
    • createStandaloneAuditEventLogger

      public static AuditEventLogFormat2Logger createStandaloneAuditEventLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, boolean forceUseLas, @Nullable String timeZoneName)
      Create and initialize an audit event log, and don't verify the logger checksum.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      forceUseLas - if true, always use the LogAggregatorService
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized AuditEventLogFormat2Logger
    • createProcessEventLogger

      public static ProcessEventLogFormat2Logger createProcessEventLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, boolean forceUseLas, @Nullable String timeZoneName)
      Create and initialize a process event log.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      forceUseLas - if true, always use the LogAggregatorService
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized ProcessEventLogFormat2Logger
    • createStandaloneProcessEventLogger

      public static ProcessEventLogFormat2Logger createStandaloneProcessEventLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, boolean forceUseLas, @Nullable String timeZoneName)
      Create and initialize a process event log, and don't verify the logger checksum.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      forceUseLas - if true, always use the LogAggregatorService
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized ProcessEventLogFormat2Logger
    • createProcessInfoLogger

      public static ProcessInfoFormat1Logger createProcessInfoLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, boolean forceUseLas, @Nullable String timeZoneName)
      Create and initialize a process info log.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      forceUseLas - if true, always use the LogAggregatorService
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized ProcessInfoLogger
    • createProcessMetricsLogger

      public static ProcessMetricsFormat1Logger createProcessMetricsLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, boolean forceUseLas, @Nullable String timeZoneName)
      Create and initialize a process metrics log.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      forceUseLas - if true, always use the LogAggregatorService
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized ProcessMetricsLogger
    • createIntradayLogger

      public static <T extends com.illumon.intradaylogger.IntradayLogger> T createIntradayLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, @NotNull Class<T> loggerClass, @Nullable String timeZoneName)
      Create an Intraday logger using the namespace and table name from the schema.
      • The column partition value will be determined either by the date when the logged row is written using the specified time zone, or determined dynamically from the schema and data if the properties specify this (processName.useDynamicPartitions=true or loggerClass.processName.useDynamicPartitions=true).
      • The rows will be written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true).
      • Use a NamespaceSet of SYSTEM.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      loggerClass - the Class to be instantiated
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      Returns:
      an initialized ProcessEventLogFormat(n)Logger
    • createIntradayLogger

      public static <T extends com.illumon.intradaylogger.IntradayLogger,​ U> T createIntradayLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, @NotNull Class<T> loggerClass, @Nullable String timeZoneName, @NotNull Function<U,​String> columnPartitionFunction)
      Create an Intraday logger using the namespace and table name from the schema. This constructor is intended for use with a column partition function, used to arbitrarily determine the column partition values based on logged data.
      • The column partition value will be determined either by the date when the logged row is written using the specified time zone, or determined dynamically from the schema and data if the properties specify this (processName.useDynamicPartitions=true or loggerClass.processName.useDynamicPartitions=true).
      • The rows will be written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true).
      • Use a NamespaceSet of SYSTEM.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      loggerClass - the Class to be instantiated
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      columnPartitionFunction - for function-based column partition determination, a function to be used to compute the column partition value
      Returns:
      an initialized ProcessEventLogFormat(n)Logger
    • createIntradayLogger

      public static <T extends com.illumon.intradaylogger.IntradayLogger,​ U> T createIntradayLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, @NotNull Class<T> loggerClass, @Nullable String timeZoneName, @Nullable Function<U,​String> columnPartitionFunction, boolean forceUseLas)
      Create an Intraday logger using the namespace and table name from the schema.
      • The column partition value will be determined either by the date when the logged row is written using the specified time zone, or determined dynamically from the schema and data if the properties specify this (processName.useDynamicPartitions=true or loggerClass.processName.useDynamicPartitions=true).
      • The rows will be written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true) or forceUseLas is true.
      • Use a NamespaceSet of SYSTEM.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      loggerClass - the Class to be instantiated
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      columnPartitionFunction - for function-based column partition determination, a function to be used to compute the column partition value
      forceUseLas - if true, always use the LAS
      Returns:
      an initialized logger
    • createStandaloneIntradayLogger

      public static <T extends com.illumon.intradaylogger.IntradayLogger,​ U> T createStandaloneIntradayLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, @NotNull Class<T> loggerClass, @Nullable String timeZoneName, @Nullable Function<U,​String> columnPartitionFunction, boolean forceUseLas)
      Create a standalone (does not verify checksum) Intraday logger using the namespace and table name from the generated logger.
      • The column partition value will be determined either by the date when the logged row is written using the specified time zone, or determined dynamically from the schema and data if the properties specify this (processName.useDynamicPartitions=true or loggerClass.processName.useDynamicPartitions=true).
      • The rows will be written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true) or forceUseLas is true.
      • Use a NamespaceSet of SYSTEM.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      loggerClass - the Class to be instantiated
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      columnPartitionFunction - for function-based column partition determination, a function to be used to compute the column partition value
      forceUseLas - if true, always use the LAS
      Returns:
      an initialized logger
    • createIntradayLogger

      public static <T extends com.illumon.intradaylogger.IntradayLogger,​ U> T createIntradayLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, @Nullable String namespace, @Nullable String tableName, @NotNull Class<T> loggerClass, @Nullable String timeZoneName, @Nullable Function<U,​String> columnPartitionFunction, boolean forceUseLas)
      Create an Intraday logger. This constructor is intended to allow the namespace and table name to be specified, overriding the default value from the schema.
      • The column partition value will be determined either by the date when the logged row is written using the specified time zone, or determined dynamically from the schema and data if the properties specify this (processName.useDynamicPartitions=true or loggerClass.processName.useDynamicPartitions=true).
      • The rows will be written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true) or forceUseLas is true.
      • Use a NamespaceSet of SYSTEM.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      namespace - the namespace for the new logger, or null if the logger's default namespace should be used
      tableName - the table name for the new logger, or null if the logger's default table name should be used
      loggerClass - the Class to be instantiated
      timeZoneName - the name of the time zone to be used to determine column partition values and file name date-time stamps. If none is provided the system default will be used. This is ignored for non-dynamic loggers using the log aggregator service.
      columnPartitionFunction - for function-based column partition determination, a function to be used to compute the column partition value
      forceUseLas - if true, always use the LAS
      Returns:
      an initialized logger
    • createIntradayLogger

      public static <T extends com.illumon.intradaylogger.IntradayLogger> T createIntradayLogger​(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull String processName, @NotNull com.fishlib.io.logger.Logger log, @NotNull Class<T> loggerClass, @Nullable String timeZoneName, @NotNull String columnPartitionValue)
      Create an Intraday logger using the namespace and table name from the schema, using the specified column partition value. This constructor is intended for use when a single column partition value will be used for all rows.
      • The rows will be written directly to binary log files unless the properties specify to use the log aggregator service (processName.useLogAggregatorService=true or loggerClass.processName.useLogAggregatorService=true).
      • The time zone name is used only to determine the date-time stamp on binary log files.
      • Use a NamespaceSet of SYSTEM.
      Parameters:
      configuration - Configuration instance
      processName - property prefix to be used for log creation and initialization
      log - log to be used during initialization
      loggerClass - the Class to be instantiated
      timeZoneName - the name of the time zone to be used to determine file name date-time stamp - if none is provided the system default will be used
      columnPartitionValue - if provided, the column partition value, which will override any dynamic partitioning properties
      Returns:
      an initialized logger