EDMIService: Reload Config every 5 mins and change tracelogging/debug logging based on debug option in config
This commit is contained in:
@@ -63,6 +63,19 @@ Public Class WindowsService
|
||||
_Config = _ConfigManager.Config
|
||||
_LogConfig.Debug = _ConfigManager.Config.Debug
|
||||
|
||||
UpdateTraceLogging()
|
||||
|
||||
Dim oTimer As New Timers.Timer(60000)
|
||||
AddHandler oTimer.Elapsed, Sub()
|
||||
_Logger.Debug("Reloading config..")
|
||||
_ConfigManager.Reload()
|
||||
_Config = _ConfigManager.Config
|
||||
_LogConfig.Debug = _ConfigManager.Config.Debug
|
||||
|
||||
UpdateTraceLogging()
|
||||
End Sub
|
||||
oTimer.Start()
|
||||
|
||||
_Logger.Debug("Connecting to Databases")
|
||||
|
||||
_Firebird = StartFirebird()
|
||||
@@ -119,6 +132,18 @@ Public Class WindowsService
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateTraceLogging()
|
||||
' Changing Tracelevels programmatically,
|
||||
' See: https://wcfpro.wordpress.com/2010/11/21/how-to-add-wcf-traces-programmatically/
|
||||
Dim oTraceLevel = SourceLevels.Off
|
||||
|
||||
If _ConfigManager.Config.Debug Then
|
||||
oTraceLevel = SourceLevels.Warning
|
||||
End If
|
||||
|
||||
WcfTracesController.Instance.LevelController(oTraceLevel)
|
||||
End Sub
|
||||
|
||||
Private Function StartFirebird() As Firebird
|
||||
_Logger.Debug("Connecting to Firebird")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user