serilog-mssql / serilog-sinks-mssqlserver

A Serilog sink that writes events to Microsoft SQL Server and Azure SQL
Apache License 2.0
283 stars 148 forks source link

Config Log within 1 month #519

Closed stone89son closed 9 months ago

stone89son commented 9 months ago

I have read the instructions but did not find the following guidelines:

Is there a way to configure serilog with MsSql to store Log within 1 month?

ckadluba commented 9 months ago

Hi @stone89son!

This sink does not have any log retention or automatic log deletion features. We had a PR and a discussion about this but then came to the conclusion that there were too many unanswered questions on how to implement such a feature in a clean and generic way so it would fit most scenarios.

If you want to clean your log table from older logs, I would recommend to use an SQL Server agent job for that.