Skip to content
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

How to write a custom logging provider #11842

Closed
tdykstra opened this issue Apr 4, 2019 — with docs.microsoft.com · 10 comments
Closed

How to write a custom logging provider #11842

tdykstra opened this issue Apr 4, 2019 — with docs.microsoft.com · 10 comments
Assignees
Labels
doc-idea Source - Docs.ms Docs Customer feedback via GitHub Issue
Milestone

Comments

Copy link
Contributor

tdykstra commented Apr 4, 2019

One reason for needing a new doc about writing custom logging providers: no built-in logging providers are available that can be used to follow the advice in the No asynchronous logger methods section. See #11801


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added the Source - Docs.ms Docs Customer feedback via GitHub Issue label Apr 4, 2019
@Rick-Anderson Rick-Anderson added this to the Backlog milestone Apr 5, 2019
@haakoo
Copy link

haakoo commented Aug 27, 2019

It would also be nice if this example showed how to pass a dependency to the custom logging provider.

I'm trying to figure out how to implement an ILogger that prints to my GUI.

@IanKemp
Copy link
Contributor

IanKemp commented Sep 11, 2019

This article is pretty long-winded but gets the job done, so it could maybe be adapted for MS docs? https://www.codeproject.com/Articles/1556475/How-to-Write-a-Custom-Logging-Provider-in-ASP-NET

Edit: this one is a lot more concise https://asp.net-hacker.rocks/2017/05/05/add-custom-logging-in-aspnetcore.html

@JuergenGutsch
Copy link
Contributor

@IanKemp Thanks for sharing my post here as an example.

If it's okay for you all, I would be glad to write that documentation. :-)

@Rick-Anderson Rick-Anderson removed the DR label Dec 3, 2019
@Rick-Anderson
Copy link
Contributor

@JuergenGutsch let me know what I can do to help. If you want to create a PR with the content, I can clean it up or assign someone to do that.

@Rick-Anderson Rick-Anderson removed the PU label Dec 11, 2019
@Rick-Anderson
Copy link
Contributor

This is tracked in #16174

@Rick-Anderson
Copy link
Contributor

@serpent5 can you add a link to additional resources

* [How to add custom logging in ASP.NET Core](https://asp.net-hacker.rocks/2017/05/05/add-custom-logging-in-aspnetcore.html)

The sample looks solid to me.

@Rick-Anderson
Copy link
Contributor

Rick-Anderson commented May 7, 2020

@JuergenGutsch let me know if you'd like to provide a sample. We can help you through the PR process.

The easiest way to do this is:

  • Create a PR with a 3.1 sample, ie AspNetCore.Docs/aspnetcore/fundamentals/logging/loggermessage/samples/3.1/CustomLogger
  • Add a readme.txt file in that folder. You can copy/paste the HTML output from your blog.

I'll then migrate your readme.txt file to this logging MD file.

Feel free to add the instructions directly to the Content Source: aspnetcore/fundamentals/logging/index.md and I'll edit your PR.

@JuergenGutsch
Copy link
Contributor

Hey @Rick-Anderson
Sorry, for being that late. Unfortunately I had some completely different priorities the last months :-(

I'm going to start adding the sample later today :-)

@Rick-Anderson
Copy link
Contributor

@JuergenGutsch awesome. Let me know what I can do to help.

JuergenGutsch added a commit to JuergenGutsch/AspNetCore.Docs that referenced this issue May 11, 2020
* Add a section in the docs aspnetcore/fundamentals/logging/index.md
* Add a sample at aspnetcore/fundamentals/logging/loggermessage/samples/3.1/CustomLogger
@JuergenGutsch
Copy link
Contributor

@Rick-Anderson I just created the PR (#18252)

Rick-Anderson added a commit that referenced this issue May 13, 2020
* Add custom logger documentaions (#11842)

* Add a section in the docs aspnetcore/fundamentals/logging/index.md
* Add a sample at aspnetcore/fundamentals/logging/loggermessage/samples/3.1/CustomLogger

* Custom loggiing

* Custom loggiing

* Custom loggiing

* Custom loggiing

* Custom loggiing

* Custom loggiing

* Apply suggestions from code review

Co-authored-by: Brennan <brecon@microsoft.com>

* react to feedback

* react to feedback

* react to feedback

Co-authored-by: Juergen Gutsch <juergen@gutsch-online.de>
Co-authored-by: Brennan <brecon@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-idea Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants