Lastly, because of an odd strategy that I’ve seen implemented in many projects: print the logs on console, add an agent that reads them and stores them in memory, and then send all the logs to the destination platform at once in this way, you’ll perform fewer HTTP requests against those platforms, making you save money and avoiding reaching the connection limit of the destination platform. Then, writing on Console is great when debugging locally: just spin up your application, run the code you need, and check what happened on the logs in this way you can understand the internal state of the application, which warnings and errors occurred, and more. Why should we write logs on Console? We should store them somewhere, to analyze them!īut still, printing logs on Console can be useful in many ways.įirst of all, by printing on Console you can check that the logging is actually working, and you haven’t missed a configuration. NET projects: we will learn how to configure it to print the logs on a Console. In this article, we will see how to add Serilog, a popular logger library, to our. To define a good logging strategy, we need two parts, equally important: adding logs to our code and analyzing the data produced by our logs. Having meaningful logs is crucial for any application: without logs, we would not be able to see if errors occur, what’s the status of the application, if there are strange behaviors that should worry us, and so on.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |