Package com.illumon.iris.db.util.logging
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>
TcreateIntradayLogger(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>
TcreateIntradayLogger(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>
TcreateIntradayLogger(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>
TcreateIntradayLogger(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>
TcreateIntradayLogger(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>
TcreateStandaloneIntradayLogger(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.
-
Constructor Details
-
EventLoggerFactory
public EventLoggerFactory()
-
-
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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationforceUseLas
- if true, always use the LogAggregatorServicetimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationforceUseLas
- if true, always use the LogAggregatorServicetimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationforceUseLas
- if true, always use the LogAggregatorServicetimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationforceUseLas
- if true, always use the LogAggregatorServicetimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationforceUseLas
- if true, always use the LogAggregatorServicetimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationforceUseLas
- if true, always use the LogAggregatorServicetimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationloggerClass
- the Class to be instantiatedtimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationloggerClass
- the Class to be instantiatedtimeZoneName
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationloggerClass
- the Class to be instantiatedtimeZoneName
- 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 valueforceUseLas
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationloggerClass
- the Class to be instantiatedtimeZoneName
- 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 valueforceUseLas
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationnamespace
- the namespace for the new logger, or null if the logger's default namespace should be usedtableName
- the table name for the new logger, or null if the logger's default table name should be usedloggerClass
- the Class to be instantiatedtimeZoneName
- 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 valueforceUseLas
- 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 instanceprocessName
- property prefix to be used for log creation and initializationlog
- log to be used during initializationloggerClass
- the Class to be instantiatedtimeZoneName
- 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 usedcolumnPartitionValue
- if provided, the column partition value, which will override any dynamic partitioning properties- Returns:
- an initialized logger
-