-
Notifications
You must be signed in to change notification settings - Fork 25k
Remove problematic factory.create.logger /7 #30249
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
Conversation
aspnetcore/fundamentals/logging/index/samples/6.x/WebLog/Program.cs
Outdated
Show resolved
Hide resolved
| // </snippet4> | ||
| var app = builder.Build(); | ||
|
|
||
| app.MapGet("/", () => "Hello World!"); | ||
|
|
||
| app.Run(); | ||
| // </snippet4> |
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.
there are two snippet4 end tags
…am.cs Co-authored-by: Noah Falk <[email protected]>
|
|
||
| `ILogger<T>` is equivalent to calling `CreateLogger` with the fully qualified type name of `T`. | ||
|
|
||
| ***NOTE:*** [LoggerFactory.Create](/dotnet/api/microsoft.extensions.logging.loggerfactory.create) Creates a new instance of <xref:Microsoft.Extensions.Logging.ILoggerFactory> that's configured using the provided `configure` delegate. The new instance of `ILoggerFactory` creates a new logging pipeline, different from the default logging pipeline. The new logging pipeline is not configured by the `Logging` section of `appsettings.json` or `appsettings.{ENVIRONMENT}.json`. For more information, see [Logging configuration](xref:fundamentals/logging/index#configure-logging). |
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.
@noahfalk @cijothomas who can review this NOTE: and suggest more accurate wording. Much of it was written by the ChatGPT plugin for VS.
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.
The text of the note seems quite accurate to me, but the note itself feels disconnected from the text around it. Assuming that we make the other changes in the snippets then this docs page will have no references to using LoggerFactory.Create and I think the note can be omitted. I am guessing a lot of the confusion was occurring because some sample snippets were using LoggerFactory.Create and people would copy those snippets.
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.
Assuming that we make the other changes in the snippets then this docs page will have no references to using LoggerFactory.Create and I think the note can be omitted.
+1
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.
(Very impressed with ChatGPT's notes, btw!)
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.
@Rick-Anderson I suggest to remove this note. Its no longer needed, and having it there is probably confusing without any context.
noahfalk
left a comment
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 suggested a few fixes, otherwise looks good 👍
aspnetcore/fundamentals/logging/index/samples/6.x/WebLog/Program.cs
Outdated
Show resolved
Hide resolved
aspnetcore/fundamentals/logging/index/samples/6.x/WebLog/Program.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Noah Falk <[email protected]>
Fixes #30239
Internal previews