예제 #1
0
 /// <summary>
 /// Writes logs to a blob
 /// </summary>
 /// <param name="configuration">Configuration reference</param>
 /// <param name="blobStorage">Valid blob storage reference</param>
 /// <param name="documentId">ID of the document to append to</param>
 /// <param name="format">Optional format string</param>
 /// <returns></returns>
 public static ILogConfiguration StorageAppendBlob(this IWriterConfiguration configuration,
                                                   IBlobStorage blobStorage,
                                                   string documentId,
                                                   string format = null)
 {
     return(configuration.Custom(new BlobStorageLogWriter(blobStorage, documentId, format)));
 }
 /// <summary>
 /// Writes to Azure Table Storage
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="storageAccountName">Azure Storage account name</param>
 /// <param name="storageAccountKey">Azure Storage account key</param>
 /// <param name="tableName">Name of the table to write to</param>
 /// <returns></returns>
 public static ILogConfiguration AzureTable(this IWriterConfiguration configuration,
                                            string storageAccountName,
                                            string storageAccountKey,
                                            string tableName)
 {
     return(configuration.Custom(new AzureTableLogWriter(storageAccountName, storageAccountKey, tableName)));
 }
예제 #3
0
        /// <summary>
        /// Adds Azure Application Insights writer
        /// </summary>
        /// <param name="configuration">Configuration reference</param>
        /// <param name="instrumentationKey">Instrumentation key</param>
        public static ILogConfiguration AzureApplicationInsights(this IWriterConfiguration configuration, string instrumentationKey,
                                                                 WriterOptions options)
        {
            if (options == null)
            {
                options = new WriterOptions();
            }

            return(configuration.Custom(new ApplicationInsightsWriter(instrumentationKey, options)));
        }
        /// <summary>
        /// Adds Azure Application Insights writer
        /// </summary>
        /// <param name="configuration">Configuration reference</param>
        /// <param name="instrumentationKey">Instrumentation key</param>
        /// <param name="flushOnWrite">When true, flush will be forced on every write</param>
        /// <returns></returns>
        public static ILogConfiguration AzureApplicationInsights(this IWriterConfiguration configuration, string instrumentationKey,
                                                                 bool traceExceptions = true,
                                                                 bool flushOnWrite    = false)
        {
            var options = new WriterOptions
            {
                FlushOnWrite    = flushOnWrite,
                TraceExceptions = traceExceptions
            };

            return(configuration.Custom(new ApplicationInsightsWriter(instrumentationKey, options)));
        }
 /// <summary>
 /// Writes to Azure Append Blob
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="storageAccountName">Azure Storage account name</param>
 /// <param name="storageAccountKey">Azure Storage account key</param>
 /// <param name="containerName">Azure Storage container name</param>
 /// <param name="blobNamePrefix">Prefix to give to files in the blob storage i.e. "myapp-"</param>
 /// <returns></returns>
 public static ILogConfiguration AzureAppendBlob(this IWriterConfiguration configuration,
                                                 string storageAccountName,
                                                 string storageAccountKey,
                                                 string containerName,
                                                 string blobNamePrefix)
 {
     return(configuration.Custom(new AzureAppendBlobLogWriter(
                                     storageAccountName,
                                     storageAccountKey,
                                     containerName,
                                     blobNamePrefix)));
 }
 /// <summary>
 /// Writes events to Seq server (https://getseq.net/)
 /// </summary>
 public static ILogConfiguration Seq(this IWriterConfiguration configuration, Uri serverAddress, string apiKey)
 {
     return(configuration.Custom(new SeqWriter(serverAddress, apiKey)));
 }
 /// <summary>
 /// Writes events to Seq server (https://getseq.net/)
 /// </summary>
 public static ILogConfiguration Seq(this IWriterConfiguration configuration, Uri serverAddress)
 {
     return(configuration.Custom(new SeqWriter(serverAddress, null)));
 }
 /// <summary>
 /// Writes to file on disk and rolls it over every day.
 /// </summary>
 public static ILogConfiguration File(this IWriterConfiguration configuration, string fileName, string format)
 {
     return(configuration.Custom(new FileLogWriter(fileName, format)));
 }
 /// <summary>
 /// Writes to .NET trace
 /// </summary>
 public static ILogConfiguration Trace(this IWriterConfiguration configuration, string format)
 {
     return(configuration.Custom(new TraceLogWriter(format)));
 }
예제 #10
0
 /// <summary>
 /// Writes to posh system console i.e. with nice colours
 /// </summary>
 public static ILogConfiguration PoshConsole(this IWriterConfiguration configuration, string format, bool logProperties = true)
 {
     return(configuration.Custom(new PoshConsoleLogWriter(format, logProperties)));
 }
 /// <summary>
 /// Writes to posh system console i.e. with nice colours
 /// </summary>
 public static ILogConfiguration PoshConsole(this IWriterConfiguration configuration, string format)
 {
     return(configuration.Custom(new PoshConsoleLogWriter(format)));
 }
 /// <summary>
 /// Writes to posh system console i.e. with nice colours
 /// </summary>
 public static ILogConfiguration PoshConsole(this IWriterConfiguration configuration)
 {
     return(configuration.Custom(new PoshConsoleLogWriter(null)));
 }
예제 #13
0
 /// <summary>
 /// Adds Azure Application Insights writer
 /// </summary>
 /// <param name="configuration">Configuration reference</param>
 /// <param name="instrumentationKey">Instrumentation key</param>
 /// <param name="flushOnWrite">When true, flush will be forced on every write</param>
 /// <returns></returns>
 public static ILogConfiguration AzureApplicationInsights(this IWriterConfiguration configuration, string instrumentationKey,
                                                          bool flushOnWrite = false)
 {
     return(configuration.Custom(new ApplicationInsightsWriter(instrumentationKey, flushOnWrite)));
 }
예제 #14
0
 public static ILogConfiguration WindowsSpeech(this IWriterConfiguration configuration,
                                               string whatToSayOnError, bool speakErrorMessage)
 {
     return(configuration.Custom(new WindowsSpeechLogWriter(whatToSayOnError, speakErrorMessage)));
 }
 /// <summary>
 /// Writes to .NET trace
 /// </summary>
 public static ILogConfiguration Trace(this IWriterConfiguration configuration)
 {
     return(configuration.Custom(new TraceLogWriter(null)));
 }
예제 #16
0
 /// <summary>
 /// Integrates with Service Fabric Health Reports
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="context"></param>
 /// <returns></returns>
 public static ILogConfiguration AzureServiceFabricHealthReport(this IWriterConfiguration configuration, ServiceContext context)
 {
     return(configuration.Custom(new HealthReportWriter(context)));
 }
예제 #17
0
 /// <summary>
 /// Writes to system console
 /// </summary>
 public static ILogConfiguration Console(this IWriterConfiguration configuration, bool logProperties = true)
 {
     return(configuration.Custom(new ConsoleLogWriter(null, logProperties)));
 }