Class Logging

Contains static information which affects all ETLBox tasks and general logging behavior for all components. Here you can set default connections string, disbale the logging for all processes or set the current stage used in your logging configuration.

Inheritance
System.Object
Logging
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.Logging
Assembly: ETLBox.dll
Syntax
    public static class Logging

Fields

DEFAULTLOADPROCESSTABLENAME

Declaration
    public const string DEFAULTLOADPROCESSTABLENAME = "etlbox_loadprocess"
Field Value
TypeDescription
System.String

DEFAULTLOGTABLENAME

The default log table name

Declaration
    public const string DEFAULTLOGTABLENAME = "etlbox_log"
Field Value
TypeDescription
System.String

Properties

CurrentLoadProcess

If you used the logging task StartLoadProces (and created the corresponding load process table before) then this Property will hold the current load process information.

Declaration
    public static LoadProcess CurrentLoadProcess { get; }
Property Value
TypeDescription
LoadProcess

DisableAllLogging

If set to true, nothing will be logged by any control flow task or data flow component. When switched back to false, all tasks and components will continue to log.

Declaration
    public static bool DisableAllLogging { get; set; }
Property Value
TypeDescription
System.Boolean

LoadProcessTable

TableName of the current load process logging table

Declaration
    public static string LoadProcessTable { get; set; }
Property Value
TypeDescription
System.String

LogTable

TableName of the current log process logging table

Declaration
    public static string LogTable { get; set; }
Property Value
TypeDescription
System.String

STAGE

For logging purposes only. If the stage is set, you can access the stage value in the logging configuration.

Declaration
    public static string STAGE { get; set; }
Property Value
TypeDescription
System.String

Methods

AddLoggingDatabaseToConfig(IConnectionManager)

You can also set the logging database in the nlog.config file. If you want to programmatically change the logging database, use this method.

Declaration
    public static void AddLoggingDatabaseToConfig(IConnectionManager connection)
Parameters
TypeNameDescription
IConnectionManagerconnection

The new logging database connection manager

AddLoggingDatabaseToConfig(IConnectionManager, LogLevel, String)

You can also set the logging database in the nlog.config file. If you want to programmatically change the logging database, use this method.

Declaration
    public static void AddLoggingDatabaseToConfig(IConnectionManager connection, LogLevel minLogLevel, string logTableName = "etlbox_log")
Parameters
TypeNameDescription
IConnectionManagerconnection

The new logging database connection manager

NLog.LogLevelminLogLevel

The minimum log level at which logs are written into the database

System.StringlogTableName

The name of the log table where the logs are written into

ClearSettings()

Set all settings back to default (which is null or false)

Declaration
    public static void ClearSettings()

GetLogger()

Returns the current NLog Logger instance used for the default ETL logging

Declaration
    public static Logger GetLogger()
Returns
TypeDescription
NLog.Logger