C# 클래스 Ms.Azure.Logging.Helpers.LoggingHelper

Helper class to initialize logging for Azure webroles, workerroles and webapplications
This class is meant to make it as easy as possible to enable logging, using just a few statements. Some defaults are chosen that might not fit all situations, such as a TransferInterval on the TableStorageAppender of 5 minutes.
파일 보기 프로젝트 열기: martijns/Ms.Azure.Logging

공개 메소드들

메소드 설명
ClearAllLoggers ( ) : void

Clear all existing appenders and loggers

FlushAppenders ( ) : void

Flush any appenders that we know to support flushing. Typically used to flush the TableStorageAppender just before the application shuts down.

InitializeAzureTableLogging ( CloudStorageAccount storageAccount, string customTable = null, log4net.Core.Level logLevel = null ) : void

Initializes log4net with azure table logging.

InitializeAzureTableLogging ( StorageCredentials credentials, string customTable = null, log4net.Core.Level logLevel = null ) : void

Initializes log4net with azure table logging.

InitializeFileLogging ( string logfile, log4net.Core.Level logLevel = null ) : void

Initializes log4net with file logging.

InitializeFromConfiguration ( NameValueCollection config ) : void

Initializes logging from configuration. The NameValueCollection will read the following properties: - LogType: TableStorage or File - LogStorageName: account name for the storage account - LogStorageKey: key for the storage account - LogStorageTable: optional, customize the table to log to - LogFile: Filename to log to - LogStorageString: use a connection string to indicate storage account and credentials (makes LogStorageName and LogStorageKey obsolete and has preference)

비공개 메소드들

메소드 설명
DetermineLevel ( string level ) : log4net.Core.Level

Converts a string loglevel to the correct type in order to configure an appender

Things would be so much easier and flexible if they would've made it an Enum or some collection

메소드 상세

ClearAllLoggers() 공개 정적인 메소드

Clear all existing appenders and loggers
public static ClearAllLoggers ( ) : void
리턴 void

FlushAppenders() 공개 정적인 메소드

Flush any appenders that we know to support flushing. Typically used to flush the TableStorageAppender just before the application shuts down.
public static FlushAppenders ( ) : void
리턴 void

InitializeAzureTableLogging() 공개 정적인 메소드

Initializes log4net with azure table logging.
public static InitializeAzureTableLogging ( CloudStorageAccount storageAccount, string customTable = null, log4net.Core.Level logLevel = null ) : void
storageAccount CloudStorageAccount
customTable string
logLevel log4net.Core.Level
리턴 void

InitializeAzureTableLogging() 공개 정적인 메소드

Initializes log4net with azure table logging.
public static InitializeAzureTableLogging ( StorageCredentials credentials, string customTable = null, log4net.Core.Level logLevel = null ) : void
credentials StorageCredentials
customTable string
logLevel log4net.Core.Level
리턴 void

InitializeFileLogging() 공개 정적인 메소드

Initializes log4net with file logging.
public static InitializeFileLogging ( string logfile, log4net.Core.Level logLevel = null ) : void
logfile string
logLevel log4net.Core.Level
리턴 void

InitializeFromConfiguration() 공개 정적인 메소드

Initializes logging from configuration. The NameValueCollection will read the following properties: - LogType: TableStorage or File - LogStorageName: account name for the storage account - LogStorageKey: key for the storage account - LogStorageTable: optional, customize the table to log to - LogFile: Filename to log to - LogStorageString: use a connection string to indicate storage account and credentials (makes LogStorageName and LogStorageKey obsolete and has preference)
public static InitializeFromConfiguration ( NameValueCollection config ) : void
config System.Collections.Specialized.NameValueCollection
리턴 void