![]() ![]() }) Forward your logs to an external database Settings.Blacklist = "Test/testPost, weatherforecast" To avoid specific endpoints to be included in the logging service, you should pass a list of routes or even words separated by commas in the blacklist parameter in the configuration of the middleware, as shown below: app.UseWatchDog(settings => By design this logging service will log all your requests and responses, please use it with caution. ![]() This would prevent any trail logs of your user's credentials when they interact with your application. If you got any form of authentication happening in your application, I would blacklist these endpoints for security reasons. Blacklisting of endpoints in your Web App ![]() If you don't specify any schedule the default clearance of your logs will happen on a daily basis. Settings.ClearTimeSchedule = WatchDogAutoClearScheduleEnum.Weekly Below is the implementation of this functionality: services.AddWatchDogServices(settings => If you would like to prevent any automatic log clearance you can use isAutoClear = false in the configuration of the service. If you don't want to store your logs for too long as it easily can clutter things up, you can set up a frequency/time interval for how often the logs should automatically be cleared. This library got some great built-in features you can use to get even more functionality without having to add more than a few lines of code, all of them are optional. Below is a list of how to get the most from WatchDog. That is actually all you have to do in order to get this cool logging service up and running. I have made a request for the weather forecast endpoint and this is the result of the logging service now available at WatchLog for Weather Forecast GET Request
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |