JobRunner: Improve logging
This commit is contained in:
parent
20b244c074
commit
5f6069f4a9
@ -13,21 +13,24 @@ Public Class JobRunnerService
|
||||
Private _jobrunner As JobRunner
|
||||
|
||||
Protected Overrides Sub OnStart(ByVal args() As String)
|
||||
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
|
||||
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log")) With {.Debug = True}
|
||||
_logger = _logConfig.GetLogger()
|
||||
_logger.Info("Starting Service {0}", ServiceName)
|
||||
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
|
||||
|
||||
Dim oFirebird = _config.Config.Firebird
|
||||
|
||||
Try
|
||||
|
||||
_logger.Info("Starting Service {0}", ServiceName)
|
||||
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
|
||||
_logConfig.Debug = _config.Config.Debug
|
||||
|
||||
Dim oFirebird = _config.Config.Firebird
|
||||
|
||||
_logger.Debug("Connecting to Database..")
|
||||
|
||||
_mssql = New MSSQLServer(_logConfig, _config.Config.SQLConnectionString)
|
||||
_firebird = New Firebird(_logConfig, oFirebird.DataSource, oFirebird.Database, oFirebird.User, oFirebird.Password)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
|
||||
Try
|
||||
_logger.Debug("Starting Jobrunner..")
|
||||
|
||||
_jobrunner = New JobRunner(_logConfig, _config.Config, _mssql, _firebird)
|
||||
_jobrunner.Start()
|
||||
Catch ex As Exception
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user