I wish elmah.io had a free tier for open source, pet projects that developers do at home ...etc. I don't want to be paying $17 a month for a pet project. If they had that, and developers got a lot of value from it on their pet projects, then it is an easy sell to the businesses they work for.
That sounds like a great approach and what I'm using on elmah.io too. Logging to files for having something to look through quickly when on a server (could live without this really) and then logging everything to Elasticsearch using Serilog.Sinks.ElasticSearch. In my case, I log all warnings, errors, and fatals to elmah.io as well, but that part depends on being a customer of that service of course.
A lot of good suggestion already, but let me add elmah.io to the list. We started as a cloud logger for ELMAH, but today support all versions of ASP.NET (including ASP.NET Core) and logging frameworks like log4net, Microsoft.Extensions.Logging, Serilog, etc.
You can play around with different stack traces on the Stack Trace Formatter that uses the same JavaScript library. The Demystified stack trace is here: https://elmah.io/tools/stack-trace-formatter/e9ffdcd564f64a7aa1512f8e6f8b2052
Thanks very much, yeah I will probably have to do that, divide and conquer.
No, did not check the event viewer but I will. Just there are a lot and I mean a lot of rules and it sucks to have to copy them one by one or in chunks.
Have you tried this online tool before?
https://elmah.io/tools/configvalidator/
Wonder if work stuff can be uploaded there.
I don't know much about XML, newbie here. Is the formatting of the rules important, does having extra spaces break the rules?
Like most others in this thread, I mostly use ILogger
in front of Serilog and I'm very pleased about it. Serilog logs to console locally and Elasticsearch, files, and elmah.io (disclaimer: I'm the founder of that) on production.
In some minor microservice types of services (primarily running on Azure Functions) I'm using Microsoft.Extensions.Logging exclusively. That means that I still use ILogger
but configure the destination directly on Microsoft.Extensions.Logging config. It doesn't have the rich feature set of Serilog and NLog and there aren't as many community packages to choose from. But for something like simple error logging, this works pretty well. As long as I have everything behind ILogger
, switching to Serilog is easy if things start to get complex.
To be fair against NLog, it has moved very quickly since I chose Serilog years ago. It has most of the features of Serilog and provides some additional features as well. Back then, structured logging was part of Serilog only, why the choice was easy (that means no-go to log4net). These days, I'm not so sure. Check out both Serilog and NLog and see which one has the feature set you like the best, the sinks/targets you need, etc.
elmah.io did indeed start as a cloud logger for ELMAH, the open-source project. But today, it is so much more with support for pretty much all .NET logging frameworks, uptime monitoring, deployment tracking, and much more 👍
That sounds like a great approach and what I'm using on elmah.io too. Logging to files for having something to look through quickly when on a server (could live without this really) and then logging everything to Elasticsearch using Serilog.Sinks.ElasticSearch. In my case, I log all warnings, errors, and fatals to elmah.io as well, but that part depends on being a customer of that service of course.
Another vote for Serilog. We use it for all our logging needs on elmah.io. We log both to our own service as well as to Elasticsearch with Kibana on top. I've created logging integrations for pretty much every logging framework for .NET. I must admit, that while I prefer Serilog, NLog has become pretty much as good as Serilog the recent years. There is also Microsoft.Extensions.Logging, which is a decent choice, especially when logging from .NET Core and ASP.NET Core.
I would definitely use an online service as other have stated for ease of access. For example [Https://elmah.io](elmah.io) that integrates with the most common logging frameworks for .Net both Framework and Core like log4net, Microsoft.Extensions.Logging or Serilog. If you already use one for your current logging, then it's easy to switch over to after getting a trial.