MS ZugferdService Delete LogFiles30days
This commit is contained in:
@@ -15,6 +15,21 @@ Public Class ZUGFeRDService
|
||||
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, "Digital Data", "DDZUGFeRDService")
|
||||
_logConfig.Debug = True
|
||||
_logger = _logConfig.GetLogger()
|
||||
Try
|
||||
Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory)
|
||||
|
||||
For Each file As IO.FileInfo In directory.GetFiles
|
||||
If (Now - file.CreationTime).Days > 29 Then
|
||||
file.Delete()
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
_logger.Info($"{My.Settings.SERVICE_NAME} is starting.")
|
||||
|
||||
Dim oDataSource As String = My.Settings.DB_DATASOURCE
|
||||
|
||||
Reference in New Issue
Block a user