Verbesserung der Protokollierung und Konfigurationsbereinigung

Die Änderungen umfassen:

- Anpassung der `App.config`: Entfernen veralteter Einstellungen (`FB_DATABASE`, `FB_USER`, etc.) und Hinzufügen neuer Platzhalter (`Test`).
- Verbesserte Fehlerbehandlung und Protokollierung in `Form1.vb`, `WindowsService.vb` und anderen Klassen.
- Konsistente Verwendung von Symbolen (✔, ⚠) zur Hervorhebung von Erfolgen und Warnungen.
- Aktualisierung der `Settings.settings` und Bereinigung nicht mehr benötigter Konfigurationswerte.
- Downgrade von `Microsoft.Data.SqlClient` von Version 7.0.1 auf 5.2.2.
- Entfernung redundanter Module und Codeabschnitte zur Verbesserung der Wartbarkeit.
- Verbesserte Fehlerbehandlung beim Starten und Stoppen des ServiceHosts.
- Optimierung der Protokollmeldungen für Debugging und Performance-Analysen.
This commit is contained in:
Developer01
2026-09-22 16:42:07 +02:00
parent 0f9e7c55ec
commit 9901b48b80
12 changed files with 136 additions and 140 deletions

View File

@@ -66,13 +66,13 @@ Public Class GlobalState
End Function
Public Sub LoadDoctypes()
_Logger.Info("Loading Doctypes")
_Logger.Debug("Loading Doctypes")
Try
Dim oSQL As String = "SELECT * FROM VWIDB_DOCTYPE_HANDLING"
Dim oTable As DataTable = _MSSQL_IDB.GetDatatable(oSQL)
_Logger.Info("Found [{0}] Document Types", oTable.Rows.Count)
_Logger.Info("✔ Found [{0}] Document Types", oTable.Rows.Count)
Dim oDocTypes As New List(Of Doctype)
@@ -82,7 +82,7 @@ Public Class GlobalState
.FileChangedAction = oRow.Item("CHANGED_HANDLING")
}
_Logger.Info("New Doctype [{0}]", oDoctype.Name)
_Logger.Debug("New Doctype [{0}]", oDoctype.Name)
oDocTypes.Add(oDoctype)
Next
@@ -94,13 +94,12 @@ Public Class GlobalState
Public Sub LoadObjectStores()
_Logger.Info("Loading Object Stores")
_Logger.Debug("Loading Object Stores ...")
Try
Dim oSQL As String = "SELECT * FROM VWIDB_OBJECT_STORE"
Dim oTable As DataTable = _MSSQL_IDB.GetDatatable(oSQL)
_Logger.Info("Found [{0}] Object Stores", oTable.Rows.Count)
Dim oObjectStores As New List(Of ObjectStore)
For Each oRow As DataRow In oTable.Rows
@@ -110,23 +109,24 @@ Public Class GlobalState
.Path = oRow.Item("REL_PATH"),
.Title = oRow.Item("Objectstore")
}
_Logger.Info("New Object Store [{0}]", oStore.Title)
_Logger.Debug("New Object Store [{0}]", oStore.Title)
oObjectStores.Add(oStore)
Next
ObjectStores = oObjectStores
_Logger.Info("✔ Found [{0}] Object Stores", oObjectStores.Count)
Catch ex As Exception
_Logger.Error(ex)
End Try
End Sub
Public Sub LoadConnections()
_Logger.Info("Loading Database Connections")
_Logger.Debug("Loading Database Connections ...")
Try
Dim oSQL As String = "SELECT * FROM TBDD_CONNECTION WITH (NOLOCK)"
Dim oTable As DataTable = _MSSQL_ECM.GetDatatable(oSQL)
_Logger.Info("Found [{0}] Connections", oTable.Rows.Count)
_Logger.Debug("Found [{0}] Connections!", oTable.Rows.Count)
Dim oConnections As New List(Of DatabaseConnection)
@@ -141,23 +141,25 @@ Public Class GlobalState
.Server = IIf(IsDBNull(oRow.Item("SERVER")), String.Empty, oRow.Item("SERVER")),
.Username = IIf(IsDBNull(oRow.Item("USERNAME")), String.Empty, oRow.Item("USERNAME"))
}
_Logger.Info("New Connection [{0}]", oConnection.Title)
oConnections.Add(oConnection)
_Logger.Debug("New DB Connection [{0}]", oConnection.Title)
Next
Connections = oConnections
_Logger.Info("✔ [{0}] DBConnections configured in service!", oConnections.Count)
Catch ex As Exception
_Logger.Error(ex)
End Try
End Sub
Public Sub LoadClientConfig(pConfig As Config)
_Logger.Info("Loading Client Config")
_Logger.Debug("Loading Client Config")
_Logger.Debug("ForceDirectDatabaseAccess: {0}", pConfig.ClientConfig.ForceDirectDatabaseAccess)
ClientConfig.ForceDirectDatabaseAccess = pConfig.ClientConfig.ForceDirectDatabaseAccess
ClientConfig.DocumentTypes = Doctypes
ClientConfig.ConnectionStringECM = _MSSQL_ECM.CurrentConnectionString
ClientConfig.ConnectionStringIDB = _MSSQL_IDB.CurrentConnectionString
_Logger.Info("✔ Found Client Config")
End Sub
Public Class ObjectStore