Reputation: 1061
I am creating an application consisting of several micro Services that run on Azure Service Fabric on Premises. I will host this on Windows Servers.
What is the recommended way for doing logging? I read something about using Event Tracing for Windows (ETW). Should I use this? How would I collect the logging data centrally?
Or should I use ASP.NET MVC Core Logging and save the loggs to a central fileshare?
Upvotes: 4
Views: 1142
Reputation: 1
Seq appears to have a cost structure around it, you could stand up an ELK stack as per yoape's answer. However to enrich the answer a little more you can push ETW events to Logstash via Data Shippers provided by Elastic search, it was pretty simple to do this for the Service Fabric Events in my case.
Upvotes: 0
Reputation: 5215
To be honest I would rip out all of the default SF logging and just use something standard you would use in a normal application. ETW introduces an awkward non-standard logging approach which is a pain to use. You can't use ETW on other than Windows platforms if you plan to use .NET Core in the future. Look at Log4Net, Serilog, NLog etc. with an appropriate sink. You'll have to enrich logging with SF context to understand where it's coming from as there are many instances of the same service. I use Serilog + Seq (http://getseq.net) for production apps running on premise and in Azure as this is the easiest way to understand logs.
Upvotes: 3
Reputation: 3315
You could use Azure Diagnostics EventFlow to pick up ETW events generated by you Service Dabric services. By using (and adding custom events to) the Service/ActorEventSources prepared for you in new SF services you can log ETW events from your services on top of the ETW events that the underlying Service Fabric framework gemerates.
In EventFlow you can then setup your inputs (the ETW events) and your output for these. You could here choose an output that fits you. For instance, if you are running on-prem and have an Elastic setup you could route your ETW events to that and make them searchable there. You can also extend EventFlow with your own output if you want to log to your own database for instance.
Upvotes: 4