Logging Azure Site Finishing Services

I am creating an application composed of several microservices that run on Azure Service Fabric on Premises. I will be hosting this on windows servers.

What is the recommended way of logging? I have read something about using Event Tracing for Windows (ETW). Should I use this? How can I collect registration data centrally?

Or should I use ASP.NET MVC Core Logging and store the logs in a central file archive?

+3


source to share


3 answers


To be honest, I would rip all SF entries by default and just use something standard that you would use in a normal application. ETW introduces an awkward custom registration approach that is a pain to use. You cannot use ETW on other platforms if you plan on using .NET Core in the future. Look at Log4Net, Serilog, NLog, etc. With a matching sink. You will need to enrich the logging with the SF context to understand where it is coming from, since there are many instances of the same service. I am using Serilog + Seq ( http://getseq.net ) for production applications running indoors and in Azure as it is the easiest way to understand the logs.



+3


source


You can use Azure Diagnostics EventFlow to collect ETW events that you create with Dabric services. By using (and adding custom events) to the Service / ActorEvent Sources prepared for you in the new SF services, you can log ETW events from your services on top of ETW events associated with the Service Fabric database.



In EventFlow you can configure your inputs (ETW events) and your outputs for them. Here you can choose the exit that suits you. For example, if you are preconfigured and have Elastic configured, you can route your ETW events and make them searchable. You can also extend EventFlow with your own output if you want to register with your own database, for example.

+4


source


Seq appears to have a cost structure around it, you can get up the ELK stack as per yoape's answer. However, to enrich the answer a little more, you can push ETW events to Logstash using Data Shippers provided by Elastic search, it was quite easy to do this for Fabric Service events in my case.

0


source