-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Johluo/migrate more extensions logging #20421
Conversation
Prior to reorganization, this source code was found in https://github.com/aspnet/Logging/tree/8270c545224e8734d7297e54edef5c584ee82f01
Prior to reorganization, this source code was found in https://github.com/aspnet/Logging/tree/5381f42ded1f41a3b0960bba799aed53da411401
Prior to reorganization, this source code was found in https://github.com/aspnet/Logging/tree/f7d8e4e0537eaab54dcf28c2b148b82688a3d62d
…maestro-bot/Common into merge/release/2.1-to-release/2.2
Addresses #571 Using `TaskCreationOptions.LongRunning` creates a dedicated thread, but it's released on the first await. Using Task.Run uses the thread pool instead
* Add attribute for collecting dumps for failed LoggedTest
.NET Core 2.0 reached EOL last year. This removes multi-targeting our test projects and test assets to only use .NET Core 2.1 and .NET Framework 4.6.1.
Use arcade
* Remove obsolete targets, properties, and scripts * Replace IsProductComponent with IsShipping * Undo bad merge to version.props * Update documentation, and put workarounds into a common file * Replace usages of RepositoryRoot with RepoRoot * Remove API baselines * Remove unnecessary restore feeds and split workarounds into two files * Enable PR checks on all branches, and disable autocancel
* Deprecate and replace IHostingEnvronment & IApplicationLifetime #966 * Fix startvs * Fix ref generation for obosolete
* Manualy update tooling dependencies to normalize names * Nullable
* Use Arcade's convention for setting IsPackable (must be explicitly set) * Use Arcade conventions for using DebugType and eng/Versions.props * Remove dead code * Update restore feeds in daily builds.md * Disable UsingToolNetFrameworkReferenceAssemblies in analyzer tests * Remove usage of TestGroupName (an obsolete KoreBuild setting) * Use IVT as a .csproj attribute
src/Logging/Logging.AzureAppServices/src/Microsoft.Extensions.Logging.AzureAppServices.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What, if any C# code is new?
{ | ||
var beforeCount = collection.Count; | ||
collection.TryAddEnumerable(descriptor); | ||
return beforeCount != collection.Count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since other threads can change the Count
of this shared collection, suggest instead doing something like what TryAddEnumerable(...)
does:
var implementationType = descriptor.GetImplementationType();
if (!services.Any(d =>
d.ServiceType == descriptor.ServiceType &&
d.GetImplementationType() == implementationType))
{
collection.TryAddEnumerable(descriptor);
return true;
}
return false;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you file a bug for this? I'm concerned with migrating files here, I'm not going to fix bugs as part of this PR.
src/Logging/Logging.Testing/src/Microsoft.Extensions.Logging.Testing.csproj
Outdated
Show resolved
Hide resolved
src/Logging/Logging.AzureAppServices/src/Microsoft.Extensions.Logging.AzureAppServices.csproj
Outdated
Show resolved
Hide resolved
No new C#, the only change I made was in 4294861 |
df307b4
to
f4a4346
Compare
Hmm agent down: |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@dotnet/aspnet-build This is ready to go in FYI. |
{ | ||
var beforeCount = collection.Count; | ||
collection.TryAddEnumerable(descriptor); | ||
return beforeCount != collection.Count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to self: File bug about reliability of this code.
<PropertyGroup> | ||
<Description>Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.</Description> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<NoWarn>$(NoWarn);CS1591</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have <WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>
in the root Directory.Build.props. We also have <NoWarn>$(NoWarn);CS1591</NoWarn>
in >70
projects. Is this a declaration that we'll never get around to adding XML docs?
➕ @anurse because it looks like you own a lot of those 70+
projects.
@@ -89,7 +89,7 @@ private async Task ClientCertTest(TestVariant variant, bool sendClientCert) | |||
} | |||
catch (Exception ex) | |||
{ | |||
Logger.LogError($"Certificate is invalid. Issuer name: {cert.Issuer}"); | |||
Logger.LogError($"Certificate is invalid. Issuer name: {cert?.Issuer}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand @jkotalik asked you to do this. But, what does the change have to do w/ the migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He suggested it to debug a failing test, probably it was just flaky. @jkotalik care to quarantine those tests?
Moving a few more things from extensions to aspnetcore to help remove dependencies on that repo. #19254
FYI only the last commit is interesting