From 8fa8c98c15f24ef9ed1b8bf688d7a0f6607a3aef Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 14 Nov 2018 10:32:29 -0800 Subject: [PATCH 1/3] Remove obsolete types from Azure logging --- .../AzureAppServicesDiagnosticsSettings.cs | 162 ------------------ ...AzureAppServicesLoggerFactoryExtensions.cs | 100 +---------- .../src/AzureBlobLoggerOptions.cs | 4 +- .../BatchLoggerConfigureOptions.cs | 6 +- .../src/{Internal => }/BatchingLogger.cs | 6 +- .../{Internal => }/BatchingLoggerOptions.cs | 6 +- .../{Internal => }/BatchingLoggerProvider.cs | 6 +- .../BlobAppendReferenceWrapper.cs | 8 +- .../BlobLoggerConfigureOptions.cs | 6 +- .../src/{Internal => }/BlobLoggerProvider.cs | 10 +- .../ConfigurationBasedLevelSwitcher.cs | 8 +- .../FileLoggerConfigureOptions.cs | 8 +- .../src/{Internal => }/FileLoggerProvider.cs | 12 +- .../src/{Internal => }/ICloudAppendBlob.cs | 8 +- .../src/{Internal => }/IWebAppContext.cs | 6 +- .../src/Internal/ForwardingLoggerProvider.cs | 25 --- .../src/{Internal => }/LogMessage.cs | 8 +- .../src/Properties/AssemblyInfo.cs | 1 + .../SiteConfigurationProvider.cs | 8 +- .../src/{Internal => }/WebAppContext.cs | 6 +- .../test/BatchingLoggerProviderTests.cs | 2 +- 21 files changed, 61 insertions(+), 345 deletions(-) delete mode 100644 src/Logging/Logging.AzureAppServices/src/AzureAppServicesDiagnosticsSettings.cs rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BatchLoggerConfigureOptions.cs (86%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BatchingLogger.cs (92%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BatchingLoggerOptions.cs (95%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BatchingLoggerProvider.cs (95%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BlobAppendReferenceWrapper.cs (94%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BlobLoggerConfigureOptions.cs (84%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/BlobLoggerProvider.cs (91%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/ConfigurationBasedLevelSwitcher.cs (87%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/FileLoggerConfigureOptions.cs (74%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/FileLoggerProvider.cs (85%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/ICloudAppendBlob.cs (82%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/IWebAppContext.cs (83%) delete mode 100644 src/Logging/Logging.AzureAppServices/src/Internal/ForwardingLoggerProvider.cs rename src/Logging/Logging.AzureAppServices/src/{Internal => }/LogMessage.cs (61%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/SiteConfigurationProvider.cs (79%) rename src/Logging/Logging.AzureAppServices/src/{Internal => }/WebAppContext.cs (85%) diff --git a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesDiagnosticsSettings.cs b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesDiagnosticsSettings.cs deleted file mode 100644 index f93538218f0..00000000000 --- a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesDiagnosticsSettings.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.Extensions.Logging.AzureAppServices -{ - /// - /// Settings for Azure diagnostics logging. - /// - [Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is AzureBlobLoggerOptions.")] - public class AzureAppServicesDiagnosticsSettings - { - private TimeSpan _blobCommitPeriod = TimeSpan.FromSeconds(5); - private int _blobBatchSize = 32; - private string _outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}"; - private int _retainedFileCountLimit = 2; - private int _fileSizeLimit = 10 * 1024 * 1024; - private string _blobName = "applicationLog.txt"; - private TimeSpan? _fileFlushPeriod = TimeSpan.FromSeconds(1); - private int _backgroundQueueSize; - - /// - /// Gets or sets a strictly positive value representing the maximum log size in bytes. - /// Once the log is full, no more messages will be appended. - /// Defaults to 10MB. - /// - public int FileSizeLimit - { - get { return _fileSizeLimit; } - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(FileSizeLimit)} must be positive."); - } - _fileSizeLimit = value; - } - } - - /// - /// Gets or sets a strictly positive value representing the maximum retained file count. - /// Defaults to 2. - /// - public int RetainedFileCountLimit - { - get { return _retainedFileCountLimit; } - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(RetainedFileCountLimit)} must be positive."); - } - _retainedFileCountLimit = value; - } - } - - /// - /// Gets or sets a message template describing the output messages. - /// Defaults to "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}". - /// - public string OutputTemplate - { - get { return _outputTemplate; } - set - { - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentException(nameof(value), $"{nameof(OutputTemplate)} must be non-empty string."); - } - _outputTemplate = value; - } - } - - /// - /// Gets or sets a maximum number of events to include in a single blob append batch. - /// Defaults to 32. - /// - public int BlobBatchSize - { - get { return _blobBatchSize; } - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(BlobBatchSize)} must be positive."); - } - _blobBatchSize = value; - } - } - - /// - /// Gets or sets a time to wait between checking for blob log batches. - /// Defaults to 5 seconds. - /// - public TimeSpan BlobCommitPeriod - { - get { return _blobCommitPeriod; } - set - { - if (value < TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(BlobCommitPeriod)} must be positive."); - } - _blobCommitPeriod = value; - } - } - - /// - /// Gets or sets the last section of log blob name. - /// Defaults to "applicationLog.txt". - /// - public string BlobName - { - get { return _blobName; } - set - { - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentException(nameof(value), $"{nameof(BlobName)} must be non-empty string."); - } - _blobName = value; - } - } - - /// - /// Gets or sets the maximum size of the background log message queue or 0 for no limit. - /// After maximum queue size is reached log event sink would start blocking. - /// Defaults to 0. - /// - public int BackgroundQueueSize - { - get { return _backgroundQueueSize; } - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(BackgroundQueueSize)} must be non-negative."); - } - _backgroundQueueSize = value; - } - } - - /// - /// Gets or sets the period after which logs will be flushed to disk or - /// null if auto flushing is not required. - /// Defaults to 1 second. - /// - public TimeSpan? FileFlushPeriod - { - get { return _fileFlushPeriod; } - set - { - if (value < TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(FileFlushPeriod)} must be positive."); - } - _fileFlushPeriod = value; - } - } - } -} \ No newline at end of file diff --git a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs index ea558a09740..567e72f87c1 100644 --- a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs +++ b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -93,103 +93,5 @@ private static ConfigurationBasedLevelSwitcher CreateFileFilterConfigureOptions( provider: typeof(FileLoggerProvider), levelKey: "AzureDriveTraceLevel"); } - - /// - /// Adds an Azure Web Apps diagnostics logger. - /// - /// The extension method argument - [Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddAzureWebAppDiagnostics(this ILoggingBuilder builder).")] - public static ILoggerFactory AddAzureWebAppDiagnostics(this ILoggerFactory factory) - { - return AddAzureWebAppDiagnostics(factory, new AzureAppServicesDiagnosticsSettings()); - } - - /// - /// Adds an Azure Web Apps diagnostics logger. - /// - /// The extension method argument - /// The setting object to configure loggers. - [Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddAzureWebAppDiagnostics(this ILoggingBuilder builder).")] - public static ILoggerFactory AddAzureWebAppDiagnostics(this ILoggerFactory factory, AzureAppServicesDiagnosticsSettings settings) - { - var context = WebAppContext.Default; - if (!context.IsRunningInAzureWebApp) - { - return factory; - } - - var config = SiteConfigurationProvider.GetAzureLoggingConfiguration(context); - - // Only add the provider if we're in Azure WebApp. That cannot change once the apps started - var fileOptions = new OptionsMonitor( - new OptionsFactory( - new IConfigureOptions[] - { - new FileLoggerConfigureOptions(config, context), - new ConfigureOptions(options => - { - options.FileSizeLimit = settings.FileSizeLimit; - options.RetainedFileCountLimit = settings.RetainedFileCountLimit; - options.BackgroundQueueSize = settings.BackgroundQueueSize == 0 ? (int?) null : settings.BackgroundQueueSize; - - if (settings.FileFlushPeriod != null) - { - options.FlushPeriod = settings.FileFlushPeriod.Value; - } - }) - }, - new IPostConfigureOptions[0] - ), - new[] - { - new ConfigurationChangeTokenSource(config) - }, - new OptionsCache() - ); - - var blobOptions = new OptionsMonitor( - new OptionsFactory( - new IConfigureOptions[] { - new BlobLoggerConfigureOptions(config, context), - new ConfigureOptions(options => - { - options.BlobName = settings.BlobName; - options.FlushPeriod = settings.BlobCommitPeriod; - options.BatchSize = settings.BlobBatchSize; - options.BackgroundQueueSize = settings.BackgroundQueueSize == 0 ? (int?) null : settings.BackgroundQueueSize; - }) - }, - new IPostConfigureOptions[0] - ), - new[] - { - new ConfigurationChangeTokenSource(config) - }, - new OptionsCache() - ); - - var filterOptions = new OptionsMonitor( - new OptionsFactory( - new[] - { - CreateFileFilterConfigureOptions(config), - CreateBlobFilterConfigureOptions(config) - }, - new IPostConfigureOptions[0]), - new [] { new ConfigurationChangeTokenSource(config) }, - new OptionsCache()); - - factory.AddProvider(new ForwardingLoggerProvider( - new LoggerFactory( - new ILoggerProvider[] - { - new FileLoggerProvider(fileOptions), - new BlobLoggerProvider(blobOptions) - }, - filterOptions - ) - )); - return factory; - } } } diff --git a/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs b/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs index 2f1285f8ac4..3d331fa3833 100644 --- a/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -36,4 +36,4 @@ public string BlobName internal string ApplicationInstanceId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BatchLoggerConfigureOptions.cs b/src/Logging/Logging.AzureAppServices/src/BatchLoggerConfigureOptions.cs similarity index 86% rename from src/Logging/Logging.AzureAppServices/src/Internal/BatchLoggerConfigureOptions.cs rename to src/Logging/Logging.AzureAppServices/src/BatchLoggerConfigureOptions.cs index 3982193dd8a..a50bd65b323 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BatchLoggerConfigureOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchLoggerConfigureOptions.cs @@ -4,9 +4,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { - public class BatchLoggerConfigureOptions : IConfigureOptions + internal class BatchLoggerConfigureOptions : IConfigureOptions { private readonly IConfiguration _configuration; private readonly string _isEnabledKey; @@ -33,4 +33,4 @@ private static bool TextToBoolean(string text) return result; } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BatchingLogger.cs b/src/Logging/Logging.AzureAppServices/src/BatchingLogger.cs similarity index 92% rename from src/Logging/Logging.AzureAppServices/src/Internal/BatchingLogger.cs rename to src/Logging/Logging.AzureAppServices/src/BatchingLogger.cs index e207fbf2a2c..b2960802d49 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BatchingLogger.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchingLogger.cs @@ -1,12 +1,12 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Text; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { - public class BatchingLogger : ILogger + internal class BatchingLogger : ILogger { private readonly BatchingLoggerProvider _provider; private readonly string _category; diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BatchingLoggerOptions.cs b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs similarity index 95% rename from src/Logging/Logging.AzureAppServices/src/Internal/BatchingLoggerOptions.cs rename to src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs index 89a8f2a1e74..23998fb5d11 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BatchingLoggerOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerOptions.cs @@ -1,9 +1,9 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { public class BatchingLoggerOptions { @@ -73,4 +73,4 @@ public int? BatchSize /// public bool IncludeScopes { get; set; } = false; } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BatchingLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs similarity index 95% rename from src/Logging/Logging.AzureAppServices/src/Internal/BatchingLoggerProvider.cs rename to src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs index 626412e5047..7502932b839 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BatchingLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { public abstract class BatchingLoggerProvider: ILoggerProvider, ISupportExternalScope { @@ -29,7 +29,7 @@ public abstract class BatchingLoggerProvider: ILoggerProvider, ISupportExternalS internal IExternalScopeProvider ScopeProvider => _includeScopes ? _scopeProvider : null; - protected BatchingLoggerProvider(IOptionsMonitor options) + internal BatchingLoggerProvider(IOptionsMonitor options) { // NOTE: Only IsEnabled is monitored @@ -73,7 +73,7 @@ private void UpdateOptions(BatchingLoggerOptions options) } - protected abstract Task WriteMessagesAsync(IEnumerable messages, CancellationToken token); + internal abstract Task WriteMessagesAsync(IEnumerable messages, CancellationToken token); private async Task ProcessLogQueue(object state) { diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BlobAppendReferenceWrapper.cs b/src/Logging/Logging.AzureAppServices/src/BlobAppendReferenceWrapper.cs similarity index 94% rename from src/Logging/Logging.AzureAppServices/src/Internal/BlobAppendReferenceWrapper.cs rename to src/Logging/Logging.AzureAppServices/src/BlobAppendReferenceWrapper.cs index e0702275cb2..bf6656f9f34 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BlobAppendReferenceWrapper.cs +++ b/src/Logging/Logging.AzureAppServices/src/BlobAppendReferenceWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -7,10 +7,10 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { /// - public class BlobAppendReferenceWrapper : ICloudAppendBlob + internal class BlobAppendReferenceWrapper : ICloudAppendBlob { private readonly Uri _fullUri; private readonly HttpClient _client; @@ -93,4 +93,4 @@ private static void AppendBlockQuery(UriBuilder uriBuilder) uriBuilder.Query = queryToAppend; } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BlobLoggerConfigureOptions.cs b/src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs similarity index 84% rename from src/Logging/Logging.AzureAppServices/src/Internal/BlobLoggerConfigureOptions.cs rename to src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs index 25ea1b6af6f..18aff67e81a 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BlobLoggerConfigureOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.Extensions.Configuration; @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Logging.AzureAppServices.Internal { - public class BlobLoggerConfigureOptions : BatchLoggerConfigureOptions, IConfigureOptions + internal class BlobLoggerConfigureOptions : BatchLoggerConfigureOptions, IConfigureOptions { private readonly IConfiguration _configuration; private readonly IWebAppContext _context; @@ -26,4 +26,4 @@ public void Configure(AzureBlobLoggerOptions options) options.ApplicationInstanceId = _context.SiteInstanceId; } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/BlobLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs similarity index 91% rename from src/Logging/Logging.AzureAppServices/src/Internal/BlobLoggerProvider.cs rename to src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs index 96c98fa4559..1a60bee215f 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/BlobLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -11,7 +11,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { /// /// The implementation that stores messages by appending them to Azure Blob in batches. @@ -42,7 +42,7 @@ public BlobLoggerProvider(IOptionsMonitor options) /// /// The container to store logs to. /// - public BlobLoggerProvider( + internal BlobLoggerProvider( IOptionsMonitor options, Func blobReferenceFactory) : base(options) @@ -54,7 +54,7 @@ public BlobLoggerProvider( _httpClient = new HttpClient(); } - protected override async Task WriteMessagesAsync(IEnumerable messages, CancellationToken cancellationToken) + internal override async Task WriteMessagesAsync(IEnumerable messages, CancellationToken cancellationToken) { var eventGroups = messages.GroupBy(GetBlobKey); foreach (var eventGroup in eventGroups) @@ -88,4 +88,4 @@ protected override async Task WriteMessagesAsync(IEnumerable message e.Timestamp.Hour); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/ConfigurationBasedLevelSwitcher.cs b/src/Logging/Logging.AzureAppServices/src/ConfigurationBasedLevelSwitcher.cs similarity index 87% rename from src/Logging/Logging.AzureAppServices/src/Internal/ConfigurationBasedLevelSwitcher.cs rename to src/Logging/Logging.AzureAppServices/src/ConfigurationBasedLevelSwitcher.cs index 388a4ed54ed..77e5a399d07 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/ConfigurationBasedLevelSwitcher.cs +++ b/src/Logging/Logging.AzureAppServices/src/ConfigurationBasedLevelSwitcher.cs @@ -1,13 +1,13 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { - public class ConfigurationBasedLevelSwitcher: IConfigureOptions + internal class ConfigurationBasedLevelSwitcher: IConfigureOptions { private readonly IConfiguration _configuration; private readonly Type _provider; @@ -47,4 +47,4 @@ private static LogLevel TextToLogLevel(string text) } } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/FileLoggerConfigureOptions.cs b/src/Logging/Logging.AzureAppServices/src/FileLoggerConfigureOptions.cs similarity index 74% rename from src/Logging/Logging.AzureAppServices/src/Internal/FileLoggerConfigureOptions.cs rename to src/Logging/Logging.AzureAppServices/src/FileLoggerConfigureOptions.cs index 00037bca87e..e7d8a84492c 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/FileLoggerConfigureOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/FileLoggerConfigureOptions.cs @@ -1,13 +1,13 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { - public class FileLoggerConfigureOptions : BatchLoggerConfigureOptions, IConfigureOptions + internal class FileLoggerConfigureOptions : BatchLoggerConfigureOptions, IConfigureOptions { private readonly IWebAppContext _context; @@ -23,4 +23,4 @@ public void Configure(AzureFileLoggerOptions options) options.LogDirectory = Path.Combine(_context.HomeFolder, "LogFiles", "Application"); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/FileLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs similarity index 85% rename from src/Logging/Logging.AzureAppServices/src/Internal/FileLoggerProvider.cs rename to src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs index 154f6092256..9da2dcbe5ae 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/FileLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/FileLoggerProvider.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { [ProviderAlias("AzureAppServicesFile")] public class FileLoggerProvider : BatchingLoggerProvider @@ -18,7 +18,7 @@ public class FileLoggerProvider : BatchingLoggerProvider private readonly int? _maxFileSize; private readonly int? _maxRetainedFiles; - public FileLoggerProvider(IOptionsMonitor options) : base(options) + internal FileLoggerProvider(IOptionsMonitor options) : base(options) { var loggerOptions = options.CurrentValue; _path = loggerOptions.LogDirectory; @@ -27,7 +27,7 @@ public FileLoggerProvider(IOptionsMonitor options) : bas _maxRetainedFiles = loggerOptions.RetainedFileCountLimit; } - protected override async Task WriteMessagesAsync(IEnumerable messages, CancellationToken cancellationToken) + internal override async Task WriteMessagesAsync(IEnumerable messages, CancellationToken cancellationToken) { Directory.CreateDirectory(_path); @@ -57,12 +57,12 @@ private string GetFullName((int Year, int Month, int Day) group) return Path.Combine(_path, $"{_fileName}{group.Year:0000}{group.Month:00}{group.Day:00}.txt"); } - public (int Year, int Month, int Day) GetGrouping(LogMessage message) + private (int Year, int Month, int Day) GetGrouping(LogMessage message) { return (message.Timestamp.Year, message.Timestamp.Month, message.Timestamp.Day); } - protected void RollFiles() + private void RollFiles() { if (_maxRetainedFiles > 0) { @@ -78,4 +78,4 @@ protected void RollFiles() } } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/ICloudAppendBlob.cs b/src/Logging/Logging.AzureAppServices/src/ICloudAppendBlob.cs similarity index 82% rename from src/Logging/Logging.AzureAppServices/src/Internal/ICloudAppendBlob.cs rename to src/Logging/Logging.AzureAppServices/src/ICloudAppendBlob.cs index ccca5250900..98f3b34d288 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/ICloudAppendBlob.cs +++ b/src/Logging/Logging.AzureAppServices/src/ICloudAppendBlob.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -6,12 +6,12 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { /// /// Represents an append blob, a type of blob where blocks of data are always committed to the end of the blob. /// - public interface ICloudAppendBlob + internal interface ICloudAppendBlob { /// /// Initiates an asynchronous operation to open a stream for writing to the blob. @@ -19,4 +19,4 @@ public interface ICloudAppendBlob /// A object of type that represents the asynchronous operation. Task AppendAsync(ArraySegment data, CancellationToken cancellationToken); } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/IWebAppContext.cs b/src/Logging/Logging.AzureAppServices/src/IWebAppContext.cs similarity index 83% rename from src/Logging/Logging.AzureAppServices/src/Internal/IWebAppContext.cs rename to src/Logging/Logging.AzureAppServices/src/IWebAppContext.cs index 21e29821922..a888de16afb 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/IWebAppContext.cs +++ b/src/Logging/Logging.AzureAppServices/src/IWebAppContext.cs @@ -1,12 +1,12 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { /// /// Represents an Azure WebApp context /// - public interface IWebAppContext + internal interface IWebAppContext { /// /// Gets the path to the home folder if running in Azure WebApp diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/ForwardingLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/Internal/ForwardingLoggerProvider.cs deleted file mode 100644 index 0474f0ba9e5..00000000000 --- a/src/Logging/Logging.AzureAppServices/src/Internal/ForwardingLoggerProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal -{ - internal class ForwardingLoggerProvider : ILoggerProvider - { - private readonly ILoggerFactory _loggerFactory; - - public ForwardingLoggerProvider(ILoggerFactory loggerFactory) - { - _loggerFactory = loggerFactory; - } - - public void Dispose() - { - _loggerFactory.Dispose(); - } - - public ILogger CreateLogger(string categoryName) - { - return _loggerFactory.CreateLogger(categoryName); - } - } -} \ No newline at end of file diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/LogMessage.cs b/src/Logging/Logging.AzureAppServices/src/LogMessage.cs similarity index 61% rename from src/Logging/Logging.AzureAppServices/src/Internal/LogMessage.cs rename to src/Logging/Logging.AzureAppServices/src/LogMessage.cs index b330f4dda72..1f1996c0128 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/LogMessage.cs +++ b/src/Logging/Logging.AzureAppServices/src/LogMessage.cs @@ -1,13 +1,13 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { - public struct LogMessage + internal struct LogMessage { public DateTimeOffset Timestamp { get; set; } public string Message { get; set; } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs b/src/Logging/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs index 85c4d7c575c..83f3ffe0553 100644 --- a/src/Logging/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs +++ b/src/Logging/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs @@ -5,3 +5,4 @@ [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.AzureAppServices.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/SiteConfigurationProvider.cs b/src/Logging/Logging.AzureAppServices/src/SiteConfigurationProvider.cs similarity index 79% rename from src/Logging/Logging.AzureAppServices/src/Internal/SiteConfigurationProvider.cs rename to src/Logging/Logging.AzureAppServices/src/SiteConfigurationProvider.cs index b7aa39de2c3..e685db2ebc8 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/SiteConfigurationProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/SiteConfigurationProvider.cs @@ -1,12 +1,12 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using Microsoft.Extensions.Configuration; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { - public class SiteConfigurationProvider + internal class SiteConfigurationProvider { public static IConfiguration GetAzureLoggingConfiguration(IWebAppContext context) { @@ -19,4 +19,4 @@ public static IConfiguration GetAzureLoggingConfiguration(IWebAppContext context .Build(); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/src/Internal/WebAppContext.cs b/src/Logging/Logging.AzureAppServices/src/WebAppContext.cs similarity index 85% rename from src/Logging/Logging.AzureAppServices/src/Internal/WebAppContext.cs rename to src/Logging/Logging.AzureAppServices/src/WebAppContext.cs index 774020afdbd..149766f25c1 100644 --- a/src/Logging/Logging.AzureAppServices/src/Internal/WebAppContext.cs +++ b/src/Logging/Logging.AzureAppServices/src/WebAppContext.cs @@ -1,14 +1,14 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { /// /// Represents the default implementation of . /// - public class WebAppContext : IWebAppContext + internal class WebAppContext : IWebAppContext { /// /// Gets the default instance of the WebApp context. diff --git a/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs b/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs index 9c9a42b9661..2b64fa3246a 100644 --- a/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs @@ -121,7 +121,7 @@ public TestBatchingLoggingProvider(TimeSpan? interval = null, int? maxBatchSize { } - protected override Task WriteMessagesAsync(IEnumerable messages, CancellationToken token) + internal override Task WriteMessagesAsync(IEnumerable messages, CancellationToken token) { Batches.Add(messages.ToArray()); return Task.CompletedTask; From 047bf7f655a6dd5159acbcb277d4c6c3b9958044 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 14 Nov 2018 11:06:32 -0800 Subject: [PATCH 2/3] Add breakingchanges --- .../src/breakingchanges.netcore.json | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/Logging/Logging.AzureAppServices/src/breakingchanges.netcore.json diff --git a/src/Logging/Logging.AzureAppServices/src/breakingchanges.netcore.json b/src/Logging/Logging.AzureAppServices/src/breakingchanges.netcore.json new file mode 100644 index 00000000000..7b778dd14ab --- /dev/null +++ b/src/Logging/Logging.AzureAppServices/src/breakingchanges.netcore.json @@ -0,0 +1,24 @@ +[ + { + "TypeId": "public class Microsoft.Extensions.Logging.AzureAppServices.AzureAppServicesDiagnosticsSettings", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.Extensions.Logging.AzureAppServices.AzureBlobLoggerOptions : Microsoft.Extensions.Logging.AzureAppServices.Internal.BatchingLoggerOptions", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.Extensions.Logging.AzureAppServices.AzureFileLoggerOptions : Microsoft.Extensions.Logging.AzureAppServices.Internal.BatchingLoggerOptions", + "Kind": "Removal" + }, + { + "TypeId": "public static class Microsoft.Extensions.Logging.AzureAppServicesLoggerFactoryExtensions", + "MemberId": "public static Microsoft.Extensions.Logging.ILoggerFactory AddAzureWebAppDiagnostics(this Microsoft.Extensions.Logging.ILoggerFactory factory)", + "Kind": "Removal" + }, + { + "TypeId": "public static class Microsoft.Extensions.Logging.AzureAppServicesLoggerFactoryExtensions", + "MemberId": "public static Microsoft.Extensions.Logging.ILoggerFactory AddAzureWebAppDiagnostics(this Microsoft.Extensions.Logging.ILoggerFactory factory, Microsoft.Extensions.Logging.AzureAppServices.AzureAppServicesDiagnosticsSettings settings)", + "Kind": "Removal" + } +] From e5fd30b6c92bbc245d633a7bbd5ea777822e7074 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 14 Nov 2018 12:26:11 -0800 Subject: [PATCH 3/3] Feedback --- .../src/AzureAppServicesLoggerFactoryExtensions.cs | 1 - .../src/AzureBlobLoggerOptions.cs | 1 - .../src/AzureFileLoggerOptions.cs | 3 +-- .../src/BatchingLoggerProvider.cs | 8 ++------ .../src/BlobLoggerConfigureOptions.cs | 2 +- .../src/BlobLoggerProvider.cs | 2 +- .../Logging.AzureAppServices/src/LogMessage.cs | 12 +++++++++--- .../test/AzureAppendBlobTests.cs | 3 +-- .../test/AzureBlobSinkTests.cs | 3 +-- .../AzureDiagnosticsConfigurationProviderTests.cs | 5 ++--- .../test/BatchingLoggerProviderTests.cs | 1 - .../test/ConfigureOptionsTests.cs | 3 +-- .../Logging.AzureAppServices/test/FileLoggerTests.cs | 3 +-- .../test/LoggerBuilderExtensionsTests.cs | 5 ++--- .../Logging.AzureAppServices/test/TestBlobSink.cs | 4 +--- .../test/TestFileLoggerProvider.cs | 3 +-- .../test/WebConfigurationLevelSwitchTests.cs | 3 +-- 17 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs index 567e72f87c1..cbf9ec7d35d 100644 --- a/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs +++ b/src/Logging/Logging.AzureAppServices/src/AzureAppServicesLoggerFactoryExtensions.cs @@ -6,7 +6,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging.AzureAppServices; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Microsoft.Extensions.Logging.Configuration; using Microsoft.Extensions.Options; using static Microsoft.Extensions.DependencyInjection.ServiceDescriptor; diff --git a/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs b/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs index 3d331fa3833..6af815457c4 100644 --- a/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/AzureBlobLoggerOptions.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; namespace Microsoft.Extensions.Logging.AzureAppServices { diff --git a/src/Logging/Logging.AzureAppServices/src/AzureFileLoggerOptions.cs b/src/Logging/Logging.AzureAppServices/src/AzureFileLoggerOptions.cs index d9b8e891987..30694e5fc7e 100644 --- a/src/Logging/Logging.AzureAppServices/src/AzureFileLoggerOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/AzureFileLoggerOptions.cs @@ -1,8 +1,7 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; namespace Microsoft.Extensions.Logging.AzureAppServices { diff --git a/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs index 7502932b839..5b375a2b5a8 100644 --- a/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/BatchingLoggerProvider.cs @@ -90,11 +90,7 @@ private async Task ProcessLogQueue(object state) var messagesDropped = Interlocked.Exchange(ref _messagesDropped, 0); if (messagesDropped != 0) { - _currentBatch.Add(new LogMessage() - { - Message = $"{messagesDropped} message(s) dropped because of queue size limit. Increase the queue size or decrease logging verbosity to avoid this.{Environment.NewLine}", - Timestamp = DateTimeOffset.Now - }); + _currentBatch.Add(new LogMessage(DateTimeOffset.Now, $"{messagesDropped} message(s) dropped because of queue size limit. Increase the queue size or decrease logging verbosity to avoid this.{Environment.NewLine}")); } if (_currentBatch.Count > 0) @@ -128,7 +124,7 @@ internal void AddMessage(DateTimeOffset timestamp, string message) { try { - if (!_messageQueue.TryAdd(new LogMessage { Message = message, Timestamp = timestamp }, millisecondsTimeout: 0, cancellationToken: _cancellationTokenSource.Token)) + if (!_messageQueue.TryAdd(new LogMessage(timestamp, message), millisecondsTimeout: 0, cancellationToken: _cancellationTokenSource.Token)) { Interlocked.Increment(ref _messagesDropped); } diff --git a/src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs b/src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs index 18aff67e81a..d07f76795d8 100644 --- a/src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs +++ b/src/Logging/Logging.AzureAppServices/src/BlobLoggerConfigureOptions.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Options; -namespace Microsoft.Extensions.Logging.AzureAppServices.Internal +namespace Microsoft.Extensions.Logging.AzureAppServices { internal class BlobLoggerConfigureOptions : BatchLoggerConfigureOptions, IConfigureOptions { diff --git a/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs index 1a60bee215f..abcba026fb3 100644 --- a/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/src/BlobLoggerProvider.cs @@ -28,7 +28,7 @@ public class BlobLoggerProvider : BatchingLoggerProvider /// Creates a new instance of /// /// - public BlobLoggerProvider(IOptionsMonitor options) + internal BlobLoggerProvider(IOptionsMonitor options) : this(options, null) { _blobReferenceFactory = name => new BlobAppendReferenceWrapper( diff --git a/src/Logging/Logging.AzureAppServices/src/LogMessage.cs b/src/Logging/Logging.AzureAppServices/src/LogMessage.cs index 1f1996c0128..460ebd8c0fc 100644 --- a/src/Logging/Logging.AzureAppServices/src/LogMessage.cs +++ b/src/Logging/Logging.AzureAppServices/src/LogMessage.cs @@ -5,9 +5,15 @@ namespace Microsoft.Extensions.Logging.AzureAppServices { - internal struct LogMessage + internal readonly struct LogMessage { - public DateTimeOffset Timestamp { get; set; } - public string Message { get; set; } + public LogMessage(DateTimeOffset timestamp, string message) + { + Timestamp = timestamp; + Message = message; + } + + public DateTimeOffset Timestamp { get; } + public string Message { get; } } } diff --git a/src/Logging/Logging.AzureAppServices/test/AzureAppendBlobTests.cs b/src/Logging/Logging.AzureAppServices/test/AzureAppendBlobTests.cs index e9fe0b65b1f..d9badcde31c 100644 --- a/src/Logging/Logging.AzureAppServices/test/AzureAppendBlobTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/AzureAppendBlobTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -6,7 +6,6 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Xunit; namespace Microsoft.Extensions.Logging.AzureAppServices.Test diff --git a/src/Logging/Logging.AzureAppServices/test/AzureBlobSinkTests.cs b/src/Logging/Logging.AzureAppServices/test/AzureBlobSinkTests.cs index a1ee0e97d37..d8642aeae7b 100644 --- a/src/Logging/Logging.AzureAppServices/test/AzureBlobSinkTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/AzureBlobSinkTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Moq; using Xunit; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; namespace Microsoft.Extensions.Logging.AzureAppServices.Test { diff --git a/src/Logging/Logging.AzureAppServices/test/AzureDiagnosticsConfigurationProviderTests.cs b/src/Logging/Logging.AzureAppServices/test/AzureDiagnosticsConfigurationProviderTests.cs index 51ba07f12be..c2bfa516d21 100644 --- a/src/Logging/Logging.AzureAppServices/test/AzureDiagnosticsConfigurationProviderTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/AzureDiagnosticsConfigurationProviderTests.cs @@ -1,9 +1,8 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Moq; using Xunit; @@ -67,4 +66,4 @@ public void ReadsSettingsFileAndEnvironment() } } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs b/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs index 2b64fa3246a..a8fe9d596cc 100644 --- a/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/BatchingLoggerProviderTests.cs @@ -7,7 +7,6 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Xunit; namespace Microsoft.Extensions.Logging.AzureAppServices.Test diff --git a/src/Logging/Logging.AzureAppServices/test/ConfigureOptionsTests.cs b/src/Logging/Logging.AzureAppServices/test/ConfigureOptionsTests.cs index 077ebd726a3..9d46aeb832e 100644 --- a/src/Logging/Logging.AzureAppServices/test/ConfigureOptionsTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/ConfigureOptionsTests.cs @@ -1,11 +1,10 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.IO; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Moq; using Xunit; diff --git a/src/Logging/Logging.AzureAppServices/test/FileLoggerTests.cs b/src/Logging/Logging.AzureAppServices/test/FileLoggerTests.cs index ea838b93cf2..430f8852d84 100644 --- a/src/Logging/Logging.AzureAppServices/test/FileLoggerTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/FileLoggerTests.cs @@ -5,7 +5,6 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Xunit; namespace Microsoft.Extensions.Logging.AzureAppServices.Test @@ -119,4 +118,4 @@ public async Task RespectsMaxFileCount() }, actualFiles); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/test/LoggerBuilderExtensionsTests.cs b/src/Logging/Logging.AzureAppServices/test/LoggerBuilderExtensionsTests.cs index ddf38d0137a..de148f2c3a4 100644 --- a/src/Logging/Logging.AzureAppServices/test/LoggerBuilderExtensionsTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/LoggerBuilderExtensionsTests.cs @@ -1,10 +1,9 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Microsoft.Extensions.Options; using Moq; using Xunit; @@ -66,4 +65,4 @@ public void BuilderExtensionAddsIConfigureOptions() Assert.Equal(4, serviceCollection.Count(d => d.ServiceType == typeof(IConfigureOptions))); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/test/TestBlobSink.cs b/src/Logging/Logging.AzureAppServices/test/TestBlobSink.cs index df9665e44e2..23afaf17875 100644 --- a/src/Logging/Logging.AzureAppServices/test/TestBlobSink.cs +++ b/src/Logging/Logging.AzureAppServices/test/TestBlobSink.cs @@ -1,8 +1,6 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; -using Microsoft.Extensions.Options; namespace Microsoft.Extensions.Logging.AzureAppServices.Test { @@ -27,4 +25,4 @@ protected override Task IntervalAsync(TimeSpan interval, CancellationToken cance return IntervalControl.IntervalAsync(); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/test/TestFileLoggerProvider.cs b/src/Logging/Logging.AzureAppServices/test/TestFileLoggerProvider.cs index 4b0b87c4e4a..8350133d996 100644 --- a/src/Logging/Logging.AzureAppServices/test/TestFileLoggerProvider.cs +++ b/src/Logging/Logging.AzureAppServices/test/TestFileLoggerProvider.cs @@ -4,7 +4,6 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; namespace Microsoft.Extensions.Logging.AzureAppServices.Test { @@ -33,4 +32,4 @@ protected override Task IntervalAsync(TimeSpan interval, CancellationToken cance return IntervalControl.IntervalAsync(); } } -} \ No newline at end of file +} diff --git a/src/Logging/Logging.AzureAppServices/test/WebConfigurationLevelSwitchTests.cs b/src/Logging/Logging.AzureAppServices/test/WebConfigurationLevelSwitchTests.cs index afb5dc037f6..c4f92115e77 100644 --- a/src/Logging/Logging.AzureAppServices/test/WebConfigurationLevelSwitchTests.cs +++ b/src/Logging/Logging.AzureAppServices/test/WebConfigurationLevelSwitchTests.cs @@ -1,9 +1,8 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging.AzureAppServices.Internal; using Xunit; namespace Microsoft.Extensions.Logging.AzureAppServices.Test