diff --git a/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache b/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache index 715c91b..671ed4a 100644 Binary files a/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache and b/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache differ diff --git a/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb b/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb index 9b8877a..809fdf7 100644 --- a/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb +++ b/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb @@ -16,12 +16,13 @@ Public Class ClassAllgemeineFunktionen Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND UPPER(MODULE) = UPPER('Process-Manager')" End If If ClassDatabase.Execute_non_Query(Sql, True) = True Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> User logged in....", False) + LOGGER.Debug(" >> User logged in....", False) Else - ClassLogger.Add(" >> User could not be logged in/out....", False) + LOGGER.Info(" >> User could not be logged in/out....", False) End If Catch ex As Exception - ClassLogger.Add("Error in LoginOut: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in LoginOut: " & ex.Message) End Try End Sub @@ -30,11 +31,12 @@ Public Class ClassAllgemeineFunktionen If IsNumeric(PROFIL_ID) Then Dim insert As String = "INSERT INTO TBPM_ERROR_LOG (PROFIL_ID, ERROR_MSG, ADDED_WHO) VALUES (" & PROFIL_ID & ", '" & ERR_MSG & "', '" & USR & "')" If ExecuteonMSSQL(insert, CONNECTION_STRING) <> "" Then - ClassLogger.Add("Eintrag in Log-Tabelle konnte nicht erstellt werden!!", True) + LOGGER.Info("Eintrag in Log-Tabelle konnte nicht erstellt werden!!", True) End If End If Catch ex As Exception - ClassLogger.Add("Error in Insert_LogEntry: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in Insert_LogEntry: " & ex.Message) End Try @@ -55,9 +57,10 @@ Public Class ClassAllgemeineFunktionen Try Connection.Open() Catch ex As Exception + LOGGER.Error(ex) ' DB-Connection schliessen Me.CloseMssqlDb(Connection) - ClassLogger.Add("ExecuteonMSSQL.Connection definieren - Error: " & ex.Message, True) + LOGGER.Info("ExecuteonMSSQL.Connection definieren - Error: " & ex.Message, True) Return "ExecuteonMSSQL.Connection definieren - Error: " & ex.Message End Try @@ -66,7 +69,8 @@ Public Class ClassAllgemeineFunktionen Try Command = New SqlCommand(sqlcommand, Connection) Catch ex As Exception - ClassLogger.Add("ExecuteonMSSQL.sqlcommand definieren - Error: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("ExecuteonMSSQL.sqlcommand definieren - Error: " & ex.Message, True) ' DB-Connection schliessen Me.CloseMssqlDb(Connection) Return "ExecuteonMSSQL.sqlcommand definieren - Error: " & ex.Message @@ -81,9 +85,10 @@ Public Class ClassAllgemeineFunktionen Me.CloseMssqlDb(Connection) Return "" Catch ex As Exception + LOGGER.Error(ex) 'bei einem Fehler einen Eintrag in der Logdatei erzeugen - ClassLogger.Add("ExecuteonMSSQL.Execute Command - Error: " & ex.Message, True) - ClassLogger.Add("Command-Befehl: " & Command.CommandText, True) + LOGGER.Info("ExecuteonMSSQL.Execute Command - Error: " & ex.Message, True) + LOGGER.Info("Command-Befehl: " & Command.CommandText, True) ' DB-Connection schliessen Me.CloseMssqlDb(Connection) Return "ExecuteonMSSQL.Execute Command - Error: " & ex.Message @@ -92,12 +97,13 @@ Public Class ClassAllgemeineFunktionen Else ' kann eintreten, wenn entweder die SQL-Anweisung falsch ist oder wenn die DataConnection nicht richtig aufgebaut werden konnte ' Eintrag in Logdatei machen - ClassLogger.Add("ExecuteonMSSQL.SQL-Command ist ungültig. Command-Objekt konnte nicht erstellt werden") + LOGGER.Info("ExecuteonMSSQL.SQL-Command ist ungültig. Command-Objekt konnte nicht erstellt werden") Return "ExecuteonMSSQL.SQL-Command ist ungültig. Command-Objekt konnte nicht erstellt werden" End If Catch ex As Exception + LOGGER.Error(ex) ' an dieser Stelle sollte jeder unvorhergesehene Fehler der Funktion abgefangen werden - ClassLogger.Add("ExecuteonMSSQL.Ein unbekannter Fehler in ExecuteonMSSQL - Error: " & ex.Message, True) + LOGGER.Info("ExecuteonMSSQL.Ein unbekannter Fehler in ExecuteonMSSQL - Error: " & ex.Message, True) Return "ExecuteonMSSQL.Ein unbekannter Fehler in ExecuteonMSSQL - Error: " & ex.Message End Try @@ -118,14 +124,15 @@ Public Class ClassAllgemeineFunktionen Dim xffres As String = Path & "\" & Stammname & ".xffres" If file_exists(xffres, clsWD) = True Then System.IO.File.Delete(xffres) - ClassLogger.Add(">> Datei " & xffres & " erfolgreich gelöscht", False) + LOGGER.Info(">> Datei " & xffres & " erfolgreich gelöscht", False) Return True Else Return Nothing End If Catch ex As Exception - ClassLogger.Add(" Fehler bei Delete_xffres", True) - ClassLogger.Add(">> Fehlermeldung: " & ex.Message, False) + LOGGER.Error(ex) + LOGGER.Info(" Fehler bei Delete_xffres", True) + LOGGER.Info(">> Fehlermeldung: " & ex.Message, False) End Try End Function 'Public Function Delete_File(originFile As String) @@ -133,15 +140,15 @@ Public Class ClassAllgemeineFunktionen ' If file_exists(originFile, False) = True Then ' System.IO.File.Delete(originFile) - ' ClassLogger.Add(">> Manuelles Löschen: Datei " & originFile & " erfolgreich gelöscht", False) + ' LOGGER.Info(">> Manuelles Löschen: Datei " & originFile & " erfolgreich gelöscht", False) ' Return True ' Else ' MsgBox("Die Datei konnte nicht gelsöcht werden. File NOT EXISTS", MsgBoxStyle.Exclamation) ' Return False ' End If ' Catch ex As Exception - ' ClassLogger.Add(" Fehler bei Delete_File", True) - ' ClassLogger.Add(">> Fehlermeldung: " & ex.Message, False) + ' LOGGER.Info(" Fehler bei Delete_File", True) + ' LOGGER.Info(">> Fehlermeldung: " & ex.Message, False) ' End Try 'End Function @@ -149,7 +156,7 @@ Public Class ClassAllgemeineFunktionen Try If VIEWER_PDF <> "internal" And vMove_File.EndsWith("pdf") Then Do While clsWD.CheckFileExists(vMove_File) = True 'func_check_file_use(vMove_File) - ClassLogger.Add(">> MoveRename: Datei noch geöffnet - Warten", False) + LOGGER.Info(">> MoveRename: Datei noch geöffnet - Warten", False) System.Threading.Thread.Sleep(500) Loop End If @@ -169,16 +176,17 @@ Public Class ClassAllgemeineFunktionen version = version + 1 Loop My.Computer.FileSystem.MoveFile(vMove_File, _Ziel) - ClassLogger.Add(">> Datei erfolgreich verschoben - Ziel: " & _Ziel, False) + LOGGER.Info(">> Datei erfolgreich verschoben - Ziel: " & _Ziel, False) Else - ClassLogger.Add(">> Ziel und Quellpfad sind identisch!", False) + LOGGER.Info(">> Ziel und Quellpfad sind identisch!", False) End If Return "" Catch ex As Exception - ClassLogger.Add(" Fehler bei Move2Folder", True) - ClassLogger.Add(">> Fehlermeldung", False) - ClassLogger.Add(">>" & ex.Message, False) + LOGGER.Error(ex) + LOGGER.Info(" Fehler bei Move2Folder", True) + LOGGER.Info(">> Fehlermeldung", False) + LOGGER.Info(">>" & ex.Message, False) Insert_LogEntry(Profile_ID, "Fehler bei Move2Folder: " & ex.Message, Environment.UserName) Return ex.Message End Try @@ -187,7 +195,8 @@ Public Class ClassAllgemeineFunktionen Try Return clsWD.CheckFileExists(_file) Catch ex As Exception - ClassLogger.Add("Fehler in Funktion file_exists - Fehler: ", ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Fehler in Funktion file_exists - Fehler: ", ex.Message) Return False End Try End Function @@ -229,8 +238,9 @@ Public Class ClassAllgemeineFunktionen End Select End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei checkValue_Exists:") - ClassLogger.Add(" - Unvorhergesehener Fehler bei checkValue_Exists - Fehler: " & vbNewLine & ex.Message) + LOGGER.Info(" - Unvorhergesehener Fehler bei checkValue_Exists - Fehler: " & vbNewLine & ex.Message) Return False End Try End Function @@ -261,11 +271,12 @@ Public Class ClassAllgemeineFunktionen End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unvorhergesehener Fehler bei Execute_Scalar_SQLServer" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei Ausführen sql:") Insert_LogEntry(profil_id, "Unvorhergesehener Fehler bei Execute_Scalar_Oracle: " & ex.Message, Environment.UserName) - ClassLogger.Add(" - Unvorhergesehener Fehler bei Execute_Scalar_SQLServer" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message) - ClassLogger.Add(" - SQL: " & vsql_statement, False) - ClassLogger.Add(" - Connection: " & vconnectionString, False) + LOGGER.Info(" - Unvorhergesehener Fehler bei Execute_Scalar_SQLServer" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message) + LOGGER.Info(" - SQL: " & vsql_statement, False) + LOGGER.Info(" - Connection: " & vconnectionString, False) Return 99 End Try End Function @@ -294,11 +305,12 @@ Public Class ClassAllgemeineFunktionen cmd.Dispose() cnn.Close() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unvorhergesehener Fehler bei Execute_Scalar_Oracle" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei Ausführen sql:") Insert_LogEntry(profil_id, "Unvorhergesehener Fehler bei Execute_Scalar_Oracle: " & ex.Message, Environment.UserName) - ClassLogger.Add(" - Unvorhergesehener Fehler bei Execute_Scalar_Oracle" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message) - ClassLogger.Add(" - SQL: " & vsql_statement, False) - ClassLogger.Add(" - Connection: " & vconnectionString, False) + LOGGER.Info(" - Unvorhergesehener Fehler bei Execute_Scalar_Oracle" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message) + LOGGER.Info(" - SQL: " & vsql_statement, False) + LOGGER.Info(" - Connection: " & vconnectionString, False) Return 99 End Try End Function diff --git a/app/DD_PM_WINDREAM/ClassAnnotation.vb b/app/DD_PM_WINDREAM/ClassAnnotation.vb index bb39a2b..5fa3a36 100644 --- a/app/DD_PM_WINDREAM/ClassAnnotation.vb +++ b/app/DD_PM_WINDREAM/ClassAnnotation.vb @@ -23,7 +23,8 @@ Public Class ClassAnnotation doc.Save(CURRENT_DOC_PATH) Return True Catch ex As Exception - ClassLogger.Add("Unexpected error in Annotate pdf: " & ex.Message, False) + LOGGER.Error(ex) + LOGGER.Info("Unexpected error in Annotate pdf: " & ex.Message, False) Return False End Try diff --git a/app/DD_PM_WINDREAM/ClassControlCreator.vb b/app/DD_PM_WINDREAM/ClassControlCreator.vb index adddf9c..f38efed 100644 --- a/app/DD_PM_WINDREAM/ClassControlCreator.vb +++ b/app/DD_PM_WINDREAM/ClassControlCreator.vb @@ -402,7 +402,7 @@ Public Class ClassControlCreator CURRENT_CONTROL_ID = row("GUID") CURR_CON_ID = IIf(IsDBNull(row("CONNECTION_ID")), 0, row("CONNECTION_ID")) If CURR_CON_ID = 0 Then - ClassLogger.Add(" >> CONNECTION NOT DEFINED - CTRL_GUID:" & CURRENT_CONTROL_ID, False) + LOGGER.Info(" >> CONNECTION NOT DEFINED - CTRL_GUID:" & CURRENT_CONTROL_ID, False) End If CURR_SELECT_CONTROL = IIf(IsDBNull(row("SQL_UEBERPRUEFUNG")), "", row("SQL_UEBERPRUEFUNG")) @@ -413,7 +413,8 @@ Public Class ClassControlCreator Return 0 End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in GET_CONTROL_PROPERTIES (" & ControlName & "):" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in GET_CONTROL_PROPERTIES (" & ControlName & "):" & ex.Message) Return 0 End Try @@ -432,7 +433,8 @@ Public Class ClassControlCreator Return True Catch ex As Exception - ClassLogger.Add("Unexpected Error in GET_DEPENDING_CONTROLS (" & ControlName & "):" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in GET_DEPENDING_CONTROLS (" & ControlName & "):" & ex.Message) Return 0 End Try End Function @@ -452,7 +454,8 @@ Public Class ClassControlCreator Return Nothing End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in GET_CONNECTION_INFO (" & CON_ID.ToString & "):" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in GET_CONNECTION_INFO (" & CON_ID.ToString & "):" & ex.Message) Return Nothing End Try diff --git a/app/DD_PM_WINDREAM/ClassDatabase.vb b/app/DD_PM_WINDREAM/ClassDatabase.vb index 040b201..913555f 100644 --- a/app/DD_PM_WINDREAM/ClassDatabase.vb +++ b/app/DD_PM_WINDREAM/ClassDatabase.vb @@ -28,15 +28,16 @@ Public Class ClassDatabase ' Dim conn As New OdbcConnection("dsn=" & DTConnection.Rows(0).Item("SERVER") & ";uid=" & DTConnection.Rows(0).Item("USERNAME") & ";pwd=" + DTConnection.Rows(0).Item("PASSWORD")) ' connectionString = conn.ConnectionString Case Else - ClassLogger.Add(" - ConnectionType nicht integriert", False) + LOGGER.Info(" - ConnectionType nicht integriert", False) MsgBox("ConnectionType nicht integriert", MsgBoxStyle.Critical, "Bitte Konfiguration Connection überprüfen!") End Select Else - ClassLogger.Add(" No entry for Connection-ID: " & id.ToString, True) + LOGGER.Info(" No entry for Connection-ID: " & id.ToString, True) End If Catch ex As Exception - ClassLogger.Add(" - Error in bei Get ConnectionString - Fehler: " & vbNewLine & ex.Message) + LOGGER.Error(ex) + LOGGER.Info(" - Error in bei Get ConnectionString - Fehler: " & vbNewLine & ex.Message) MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Get ConnectionString:") End Try Return connectionString @@ -50,7 +51,8 @@ Public Class ClassDatabase SQLconnect.Close() Return True Catch ex As Exception - ClassLogger.Add("Fehler bei Database-Init: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("Fehler bei Database-Init: " & ex.Message, True) Return False End Try End Function @@ -59,31 +61,32 @@ Public Class ClassDatabase Try Dim SQLconnect As New SqlClient.SqlConnection Dim SQLcommand As SqlClient.SqlCommand - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> ReturnDatatable: " & Select_anweisung, False) + LOGGER.Debug(">>> ReturnDatatable: " & Select_anweisung, False) SQLconnect.ConnectionString = SQLSERVERConnectionString SQLconnect.Open() SQLcommand = SQLconnect.CreateCommand SQLcommand.CommandText = Select_anweisung - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute ReturnDatatable: " & Select_anweisung, False) + LOGGER.Debug(">>> Execute ReturnDatatable: " & Select_anweisung, False) Dim adapter1 As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(SQLcommand) Dim dt As DataTable = New DataTable() adapter1.Fill(dt) SQLconnect.Close() Return dt Catch ex As Exception + LOGGER.Error(ex) If userInput = True Then MsgBox("Error in Return Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical) End If Clipboard.SetText("Error: " & ex.Message & vbNewLine & "SQL: " & Select_anweisung) - ClassLogger.Add("Fehler bei Return_Datatable: " & ex.Message, True) - ClassLogger.Add("#SQL: " & Select_anweisung, False) + LOGGER.Info("Fehler bei Return_Datatable: " & ex.Message, True) + LOGGER.Info("#SQL: " & Select_anweisung, False) Return Nothing End Try End Function Public Shared Function Return_Datatable_CS(Select_anweisung As String, Conn_ID As Integer, Optional userInput As Boolean = False) Try Dim ConString As String = Get_ConnectionString(Conn_ID) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> ReturnDatatable: " & Select_anweisung, False) + LOGGER.Debug(">>> ReturnDatatable: " & Select_anweisung, False) Dim SQLconnect As New SqlClient.SqlConnection Dim SQLcommand As SqlClient.SqlCommand SQLconnect.ConnectionString = ConString @@ -97,11 +100,12 @@ Public Class ClassDatabase SQLconnect.Close() Return dt Catch ex As Exception + LOGGER.Error(ex) If userInput = True Then MsgBox("Error in Return_Datatable_CS - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical) End If - ClassLogger.Add("Fehler bei Return_Datatable_CS: " & ex.Message, True) - ClassLogger.Add("#SQL: " & Select_anweisung, False) + LOGGER.Info("Fehler bei Return_Datatable_CS: " & ex.Message, True) + LOGGER.Info("#SQL: " & Select_anweisung, False) Return Nothing End Try End Function @@ -110,23 +114,24 @@ Public Class ClassDatabase Dim SQLconnect As New SqlClient.SqlConnection Dim SQLcommand As SqlClient.SqlCommand SQLconnect.ConnectionString = SQLSERVERConnectionString - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute_non_Query: " & ExecuteCMD, False) + LOGGER.Debug(">>> Execute_non_Query: " & ExecuteCMD, False) SQLconnect.Open() SQLcommand = SQLconnect.CreateCommand 'Update Last Created Record in Foo SQLcommand.CommandText = ExecuteCMD - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute NonQuery: " & ExecuteCMD, False) + LOGGER.Debug(">>> Execute NonQuery: " & ExecuteCMD, False) SQLcommand.ExecuteNonQuery() SQLcommand.Dispose() SQLconnect.Close() Return True Catch ex As Exception + LOGGER.Error(ex) If userInput = True Then MsgBox("Error in Execute non query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & ExecuteCMD, MsgBoxStyle.Critical) End If Clipboard.SetText("Error ExecuteCMD: " & ex.Message & vbNewLine & "SQL: " & ExecuteCMD) - ClassLogger.Add("Fehler bei Execute_non_Query: " & ex.Message, True) - ClassLogger.Add("#SQL: " & ExecuteCMD, False) + LOGGER.Info("Fehler bei Execute_non_Query: " & ex.Message, True) + LOGGER.Info("#SQL: " & ExecuteCMD, False) Return False End Try @@ -137,23 +142,24 @@ Public Class ClassDatabase Dim SQLconnect As New SqlClient.SqlConnection Dim SQLcommand As SqlClient.SqlCommand SQLconnect.ConnectionString = ConString - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute_non_Query: " & cmdscalar, False) + LOGGER.Debug(">>> Execute_non_Query: " & cmdscalar, False) SQLconnect.Open() SQLcommand = SQLconnect.CreateCommand 'Update Last Created Record in Foo SQLcommand.CommandText = cmdscalar - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute Scalar: " & cmdscalar, False) + LOGGER.Debug(">>> Execute Scalar: " & cmdscalar, False) result = SQLcommand.ExecuteScalar() SQLcommand.Dispose() SQLconnect.Close() Return result Catch ex As Exception + LOGGER.Error(ex) If userInput = True Then MsgBox("Error in Execute Scalar - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & cmdscalar, MsgBoxStyle.Critical) End If Clipboard.SetText("Error Execute_Scalar: " & ex.Message & vbNewLine & "SQL: " & cmdscalar) - ClassLogger.Add("Fehler bei Execute_Scalar: " & ex.Message, True) - ClassLogger.Add("#SQL: " & cmdscalar, False) + LOGGER.Info("Fehler bei Execute_Scalar: " & ex.Message, True) + LOGGER.Info("#SQL: " & cmdscalar, False) Return Nothing End Try End Function @@ -172,8 +178,9 @@ Public Class ClassDatabase SQLconnect.Close() Return result Catch ex As Exception - ClassLogger.Add("Fehler bei OracleExecute_Scalar: " & ex.Message, True) - ClassLogger.Add("#SQL: " & cmdscalar, False) + LOGGER.Error(ex) + LOGGER.Info("Fehler bei OracleExecute_Scalar: " & ex.Message, True) + LOGGER.Info("#SQL: " & cmdscalar, False) Return Nothing End Try End Function @@ -191,11 +198,12 @@ Public Class ClassDatabase SQLconnect.Close() Return True Catch ex As Exception + LOGGER.Error(ex) If userInput = True Then MsgBox("Error in OracleExecute_non_Query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & ExecuteCMD, MsgBoxStyle.Critical) End If - ClassLogger.Add("Fehler bei OracleExecute_non_Query: " & ex.Message, True) - ClassLogger.Add("#SQL: " & ExecuteCMD, False) + LOGGER.Info("Fehler bei OracleExecute_non_Query: " & ex.Message, True) + LOGGER.Info("#SQL: " & ExecuteCMD, False) Return False End Try @@ -216,11 +224,12 @@ Public Class ClassDatabase SQLconnect.Close() Return dt Catch ex As Exception + LOGGER.Error(ex) If userInput = True Then MsgBox("Error in Oracle Return Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical) End If - ClassLogger.Add("Fehler bei Oracle_Return_Datatable: " & ex.Message, True) - ClassLogger.Add("#SQL: " & Select_anweisung, False) + LOGGER.Info("Fehler bei Oracle_Return_Datatable: " & ex.Message, True) + LOGGER.Info("#SQL: " & Select_anweisung, False) Return Nothing End Try End Function diff --git a/app/DD_PM_WINDREAM/ClassDragDrop.vb b/app/DD_PM_WINDREAM/ClassDragDrop.vb index 3f8bdc0..3878538 100644 --- a/app/DD_PM_WINDREAM/ClassDragDrop.vb +++ b/app/DD_PM_WINDREAM/ClassDragDrop.vb @@ -61,6 +61,7 @@ Public Class ClassDragDrop Try dragDropData = row.Item("GUID") & "|" & source Catch ex As Exception + LOGGER.Error(ex) Try dragDropData = row.Item("USER_ID") & "|" & source Catch ex1 As Exception @@ -78,6 +79,7 @@ Public Class ClassDragDrop End If End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in view_MouseMove: " & ex.Message, MsgBoxStyle.Critical) End Try End Sub diff --git a/app/DD_PM_WINDREAM/ClassEmail.vb b/app/DD_PM_WINDREAM/ClassEmail.vb index 850a3db..9c2e99c 100644 --- a/app/DD_PM_WINDREAM/ClassEmail.vb +++ b/app/DD_PM_WINDREAM/ClassEmail.vb @@ -13,14 +13,15 @@ Public Class ClassEmail 'Für jeden Empfänger eine Neue Mail erzeugen For Each _mailempfaenger As String In empfaenger ' Neue Nachricht erzeugen: - Dim message As New MailMessage(emailfrom, _mailempfaenger, vBetreff & " - Domain: " & Environment.UserDomainName, _ - "" & vBody & "
>> Version: " & My.Application.Info.Version.ToString & "
>> Maschine: " & Environment.MachineName & "
" & "
>> Domain-Name: " & Environment.UserDomainName & "
" & _ - "
>> Gesendet am: " & My.Computer.Clock.LocalTime.ToShortDateString & " " & _ + Dim message As New MailMessage(emailfrom, _mailempfaenger, vBetreff & " - Domain: " & Environment.UserDomainName, + "" & vBody & "
>> Version: " & My.Application.Info.Version.ToString & "
>> Maschine: " & Environment.MachineName & "
" & "
>> Domain-Name: " & Environment.UserDomainName & "
" & + "
>> Gesendet am: " & My.Computer.Clock.LocalTime.ToShortDateString & " " & My.Computer.Clock.LocalTime.ToLongTimeString & "
") If test = False Then If Log = True Then ' create and add the attachment(s) */ - Dim logfile As String = ClassLogger.logDateiname + + Dim logfile As String = LOGCONFIG.LogFile If logfile.Contains("\\") Then logfile = logfile.Replace("\\", "\") End If @@ -52,11 +53,12 @@ Public Class ClassEmail If Log = True Then MsgBox("Die Support-Email wurde erfolgreich versendet!", MsgBoxStyle.Information, "Erfolgsmeldung:") End If - 'ClassLogger.Add(">> Support/Log Email erfolgreich an " & _mailempfaenger & " versendet!", False) + 'LOGGER.Info(">> Support/Log Email erfolgreich an " & _mailempfaenger & " versendet!", False) Next Return True Catch ex As Exception - ClassLogger.Add("### Fehler im Mailversand: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("### Fehler im Mailversand: " & ex.Message) Return False End Try End Function diff --git a/app/DD_PM_WINDREAM/ClassFinalIndex.vb b/app/DD_PM_WINDREAM/ClassFinalIndex.vb index c71afd0..9d6473c 100644 --- a/app/DD_PM_WINDREAM/ClassFinalIndex.vb +++ b/app/DD_PM_WINDREAM/ClassFinalIndex.vb @@ -36,6 +36,7 @@ ' Return value 'End If Catch ex As Exception + LOGGER.Error(ex) MsgBox($"Error in GetValue: {ex.Message}", MsgBoxStyle.Critical) End Try End Function @@ -90,6 +91,7 @@ Return props Catch ex As Exception + LOGGER.Error(ex) MsgBox($"Error in SetValue: {ex.Message}", MsgBoxStyle.Critical) End Try End Function diff --git a/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb b/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb index c0b7698..c2ba730 100644 --- a/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb +++ b/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb @@ -8,12 +8,12 @@ If CURRENT_DT_FINAL_INDEXING.Rows.Count > 0 Then 'Jetzt finale Indexe setzen - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> working final indices for doc: " & WMObject.aName, False) + LOGGER.Debug(" >> working final indices for doc: " & WMObject.aName, False) For Each dr As DataRow In CURRENT_DT_FINAL_INDEXING.Rows Dim value As String = dr.Item("VALUE").ToString Dim INDEXNAME = dr.Item("INDEXNAME").ToString If value.ToUpper = "SQL-Command".ToUpper Then '###### Indexierung mit variablen SQL ### - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> indexing with dynamic sql...", False) + LOGGER.Debug(" >> indexing with dynamic sql...", False) 'Dim SQL_COMMAND = dr.Item("SQL_COMMAND") '' Regulären Ausdruck zum Auslesen der Indexe definieren 'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}" @@ -25,23 +25,23 @@ '' alle Vorkommen innerhalbd er Namenkonvention durchlaufen 'For Each element As System.Text.RegularExpressions.Match In elemente ' Try - ' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False) + ' If LogErrorsOnly = False Then LOGGER.Info(" >> element in RegeX: " & element.Value, False) ' Dim WDINDEXNAME = element.Value.Substring(2, element.Value.Length - 3) ' Dim wertWD = WMObject.GetVariableValue(WDINDEXNAME) ' If Not IsNothing(wertWD) Then ' SQL_COMMAND = SQL_COMMAND.ToString.Replace(element.Value, wertWD) ' Else - ' ClassLogger.Add(">>Attention: indexvalue is invalid", False) + ' LOGGER.Info(">>Attention: indexvalue is invalid", False) ' End If ' Catch ex As Exception - ' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message) ' End Try 'Next Dim sql_Statement = clsPatterns.ReplaceUserValues(dr.Item("SQL_COMMAND"), USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) sql_Statement = clsPatterns.ReplaceInternalValues(sql_Statement) sql_Statement = clsPatterns.ReplaceWindreamIndicies(sql_Statement, WMObject) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> sql after ReplaceAllValues: " & sql_Statement, False) + LOGGER.Debug(">>> sql after ReplaceAllValues: " & sql_Statement, False) Dim dynamic_value = ClassDatabase.Execute_Scalar(sql_Statement, CONNECTION_STRING, True) If Not IsNothing(dynamic_value) Then value = dynamic_value @@ -66,11 +66,11 @@ result(0) = value Dim oIndexType = WINDREAM.GetTypeOfIndex(INDEXNAME) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> oIndexType {oIndexType.ToString}", False) + LOGGER.Debug($" >> oIndexType {oIndexType.ToString}", False) If oIndexType > 4000 And oIndexType < 5000 Then 'Hier muss nun separat als Vektorfeld indexiert werden If Indexiere_VektorfeldPM(value, INDEXNAME, WMObject) = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> FINALER INDEX '" & INDEXNAME.Replace("[%VKT", "") & "' WURDE ERFOLGREICH GESETZT", False) + LOGGER.Debug(" >> FINALER INDEX '" & INDEXNAME.Replace("[%VKT", "") & "' WURDE ERFOLGREICH GESETZT", False) Else MsgBox("Unexpected error in finalindexing vektorvalue - check the log", MsgBoxStyle.Critical) @@ -78,10 +78,10 @@ End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> now indexing..", False) + LOGGER.Debug(" >> now indexing..", False) If Indexiere_File(INDEXNAME, result, WMObject) = True Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> FINALER INDEX '" & INDEXNAME & "' WURDE ERFOLGREICH GESETZT", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add("") + LOGGER.Debug(" >> FINALER INDEX '" & INDEXNAME & "' WURDE ERFOLGREICH GESETZT", False) + LOGGER.Debug("") 'Nun das Logging If CURRENT_PROFILE_VEKTOR_LOG <> "" Then Dim logstr = Return_LOGString(value, "DDFINALINDEX", INDEXNAME) @@ -106,7 +106,8 @@ Return True End If Catch ex As Exception - ClassLogger.Add(">> unexpected error in Write_Final_Metadata: " & ex.Message.ToString, True) + LOGGER.Error(ex) + LOGGER.Info(">> unexpected error in Write_Final_Metadata: " & ex.Message.ToString, True) Return False End Try End Function @@ -126,7 +127,7 @@ 'Das Array der Idnexwerte überprüfen If idxvalue Is Nothing = False Then If idxvalue.Length() > 1 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) Dim anzahl As Integer = 0 For Each indexvalue As String In idxvalue ReDim Preserve arrValue(anzahl) @@ -134,7 +135,7 @@ anzahl += 1 Next Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) ReDim Preserve arrValue(0) arrValue(0) = idxvalue(0).ToString End If @@ -146,7 +147,7 @@ End If 'Catch ex As Exception - ' ClassLogger.Add(">> Unvorhergesehener Fehler bei Indexiere_File: " & ex.Message.ToString, True) + ' LOGGER.Info(">> Unvorhergesehener Fehler bei Indexiere_File: " & ex.Message.ToString, True) ' Return Err() 'End Try End Function @@ -198,7 +199,8 @@ Dim Bezeichner As String = VKTBezeichner.Replace("[%VKT", "") PM_String = "DD-PM#" & Bezeichner & "#" & input & "#" & Environment.UserName & "#" & Now.ToString Catch ex As Exception - ClassLogger.Add(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True) PM_String = "DD-PM ERROR: " & ex.Message End Try Return PM_String @@ -214,7 +216,8 @@ End If Catch ex As Exception - ClassLogger.Add(">> Fehler in Return_LOGString: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info(">> Fehler in Return_LOGString: " & ex.Message, True) PM_String = "DD-PM ERROR: " & ex.Message End Try Return PM_String diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index 4bf972e..78d92ac 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -19,7 +19,7 @@ Public Class ClassInit LOGGER.Info("## ProcessManager für Windream gestartet - {0}", Now) 'ClassLogger.Init("", Environment.UserName) - 'ClassLogger.Add("## ProcessManager für Windream gestartet - " & Now, False) + 'LOGGER.Info("## ProcessManager für Windream gestartet - " & Now, False) 'If LogErrorsOnly = False Then ' 'Setzt DetailLog zurück ' LogErrorsOnly = False = False @@ -53,6 +53,7 @@ Public Class ClassInit USER_MANAGER_PATH = CONFIG.Config.UserManagerPath + LOG_ERRORS_ONLY = CONFIG.Config.LogErrorsOnly LOGCONFIG.Debug = Not LOG_ERRORS_ONLY 'Settings_Load() @@ -70,6 +71,7 @@ Public Class ClassInit Try oPlaintextPassword = oDecryptor.DecryptData(oBuilder.Password) Catch ex As Exception + LOGGER.Error(ex) LOGGER.Debug("Password {0} could not be decrypted. Assuming plaintext password.") oPlaintextPassword = oBuilder.Password End Try @@ -120,11 +122,12 @@ Public Class ClassInit LICENSE_EXPIRED = True LICENSE_COUNT = 0 End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> license initialized....", False) + LOGGER.Debug(" >> license initialized....", False) LICENSE_PROFILES = split(2) Catch ex As Exception - ClassLogger.Add("Unexpected error in Refresh license: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected error in Refresh license: " & ex.Message, True) MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:") End Try End Sub @@ -147,18 +150,19 @@ Public Class ClassInit Exit Sub End If Catch ex As Exception - ClassLogger.Add("Unexpected error in checking CLIENT: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected error in checking CLIENT: " & ex.Message) CLIENT_SELECTED = 1 End Try - ClassLogger.Add(">> Username: " & USER_USERNAME, False) + LOGGER.Info(">> Username: " & USER_USERNAME, False) Dim sql = String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','PM',{1})", Environment.UserName, CLIENT_SELECTED) Dim DT_CHECKUSER_MODULE As DataTable = ClassDatabase.Return_Datatable(sql) If DT_CHECKUSER_MODULE.Rows.Count = 0 Then - ClassLogger.Add("DT_CHECKUSER_MODULE.Rows.Count = 0", True) + LOGGER.Info("DT_CHECKUSER_MODULE.Rows.Count = 0", True) ERROR_STATE = "NO USER" @@ -187,7 +191,7 @@ Public Class ClassInit USERCOUNT_LOGGED_IN = DT_CHECKUSER_MODULE.Rows(0).Item("USERCOUNT_LOGGED_IN") - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> User exists....", False) + LOGGER.Debug(" >> User exists....", False) 'Am System anmelden Refresh_Licence() 'Check_User_Exists_in_PMGroups() @@ -198,21 +202,22 @@ Public Class ClassInit ' USERCOUNT_LOGGED_IN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE = 'Process-Manager'" ClassDatabase.Execute_non_Query(sql, True) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False) + LOGGER.Debug(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False) If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then MsgBox("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") - ClassLogger.Add(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False) + LOGGER.Info(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False) If USER_IS_ADMIN = False Then ClassAllgemeineFunktionen.LoginOut("LOGOUT") - ClassLogger.Add(" - Wieder abgemeldet - START INCOMPLETE", False) + LOGGER.Info(" - Wieder abgemeldet - START INCOMPLETE", False) ERROR_STATE = "START INCOMPLETE" End If End If 'Alles OK bis hierhin...nun die FolderwatchKonfig laden - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Init Userlogin successfull completed....", False) + LOGGER.Debug(" >> Init Userlogin successfull completed....", False) End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in InitUserLogin: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in InitUserLogin: " & ex.Message, True) ERROR_STATE = "START INCOMPLETE" End Try @@ -227,7 +232,8 @@ Public Class ClassInit CURRENT_DT_TBDD_CONNECTION = ClassDatabase.Return_Datatable(sql) Settings_LoadBasicConfig() Catch ex As Exception - ClassLogger.Add("Unexpected Error in InitBasics: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in InitBasics: " & ex.Message, True) ERROR_STATE = "Basics not initialized" End Try End Sub @@ -243,12 +249,14 @@ Public Class ClassInit LICENSE_VALID = DT.Rows(0).Item("LICENSE_VALID") WMSESSION_STARTSTOP_STARTUP = DT.Rows(0).Item("WMSESSION_STARTSTOP_STARTUP") Catch ex As Exception - ClassLogger.Add("Unexpected Error in Settings_LoadBasicConfig: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Settings_LoadBasicConfig: " & ex.Message, True) End Try Else Return False End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in Settings_LoadBasicConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return False End Try diff --git a/app/DD_PM_WINDREAM/ClassLogger.vb b/app/DD_PM_WINDREAM/ClassLogger.vb deleted file mode 100644 index 7b05c8e..0000000 --- a/app/DD_PM_WINDREAM/ClassLogger.vb +++ /dev/null @@ -1,215 +0,0 @@ -Imports System.IO -Public Class ClassLogger - Public Shared DateiSpeicherort As String = Nothing - Public Shared DateiPrefix As String = "" - Public Shared Datei As IO.File = Nothing - Public Shared logDateiname As String = "" - Private Shared StreamWriter As IO.StreamWriter = Nothing - Private Shared HasInformedAboutError As Boolean = False - ' eine Art Konstruktor - Public Shared Sub Init(ByVal speicherort As String, Optional ByVal prefix As String = "", Optional ByVal appendFile As Boolean = True) - ' initialisiert den Speicherort - ClassLogger.SetSpeicherort(speicherort) - ' wenn ein Prfix gesetzt wurde - If Not prefix = "" Then - ' initialisiert das Prefix - ClassLogger.SetPrefix(prefix) - End If - Dim str As String = ClassLogger.DateiSpeicherort & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt" - Dim anz As Integer = 1 - Do While File.Exists(str) - Dim info As New FileInfo(str) - Dim length As Long = info.Length - If length > 5000000 Then - str = IO.Path.GetDirectoryName(str) - str = str & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & "(" & anz.ToString & ").txt" - anz = anz + 1 - Else - Exit Do - End If - Loop - ClassLogger.logDateiname = str - If Not appendFile Then - ' der Versuch die Datei zu löschen - 'Try - ' My.Computer.FileSystem.DeleteFile(ClassNILogger.Dateiname, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently) - 'Catch ex As Exception - ' ' bei Fehler besteht kein Schreibrecht auf die Datei oder Datei existiert nicht - ' ' ALSO: alles Okay soweit - 'End Try - My.Computer.FileSystem.WriteAllText(ClassLogger.logDateiname, String.Empty, False) - End If - ' testen ob sich die Datei öffnen und beschreiben lässt - 'ClassNILogger.CheckIsLogWritable() - End Sub - - ' legt den Speicherort fest - Public Shared Sub SetSpeicherort(ByVal speicherort As String) - Dim f As New IO.DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Digital Data\Process Manager\Log")) - - If speicherort = "" Then - If f.Exists = False Then - IO.Directory.CreateDirectory(f.ToString()) - End If - ClassLogger.DateiSpeicherort = f.ToString() - Else - ClassLogger.DateiSpeicherort = speicherort - End If - - 'Dim f As New IO.DirectoryInfo(My.Application.Info.DirectoryPath & "\Log") - 'If speicherort = "" Then - ' If f.Exists = False Then - ' IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Log") - ' End If - ' ClassLogger.DateiSpeicherort = My.Application.Info.DirectoryPath & "\Log\" - 'Else - ' ClassLogger.DateiSpeicherort = speicherort - 'End If - End Sub - - ' legt das Prefix für den Dateinamen fest - Public Shared Sub SetPrefix(ByVal prefix As String) - ClassLogger.DateiPrefix = prefix - End Sub - - Public Shared Sub Add(ByVal information As String, Optional ByVal ACHTUNG As Boolean = True) - If ClassLogger.OpenFile Then - Try - If ACHTUNG Then - ClassLogger.StreamWriter.WriteLine(System.DateTime.Now & " #ACHTUNG#: " & information) - Else - ClassLogger.StreamWriter.WriteLine(System.DateTime.Now & " " & information) - End If - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - End Try - Else - ClassLogger.ShowErrorMessage() - End If - End Sub - Public Shared Sub Add(ByVal ex As Exception) - If ClassLogger.OpenFile Then - Try - ClassLogger.StreamWriter.WriteLine("##### Exception (" & System.DateTime.Now & ")") - ClassLogger.StreamWriter.WriteLine("##### Fehler: " & ex.Message & " Source [" & ex.Source & "]") - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - End Try - Else - ClassLogger.ShowErrorMessage() - End If - End Sub - ' öffnet eine Datei zum Schreiben - Private Shared Function OpenFile() - Try - ' wenn ein Speicherort festgelegt wurde - If Not ClassLogger.DateiSpeicherort = Nothing Then - ' den Dateienamen definieren - Dim dateiname As String = ClassLogger.logDateiname - ' Datei anlegen wenn noch nicht vorhanden - My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True) - ' die Datei zum Schreiben öffnen - ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8) - End If - ' wenn die Datei erfolgreich geöffnet wurde - If ClassLogger.StreamWriter IsNot Nothing Then - Return True - Else - Return False - End If - Catch ex As Exception - Return False - End Try - - End Function - - ' öffnet eine Datei zum Schreiben - Private Shared Function OpenFile(ByVal DateiSpeicherort As String, ByVal DateiPrefix As String) - - Try - - ' wenn ein Speicherort festgelegt wurde - If Not DateiSpeicherort = Nothing And ClassLogger.CheckIsLogWritable() Then - - ' den Dateienamen definieren - Dim dateiname As String = ClassLogger.logDateiname - ' Datei anlegen wenn noch nicht vorhanden - My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True) - - ' die Datei zum Schreiben öffnen - ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8) - End If - - ' wenn die Datei erfolgreich geöffnet wurde - If ClassLogger.StreamWriter IsNot Nothing Then - Return True - Else - Return False - End If - - Catch ex As Exception - Return False - End Try - - End Function - - - ' schliesst die geöffnete Datei - Private Shared Sub CloseFile() - - ' wenn eine Datei geöffnet ist - If ClassLogger.StreamWriter IsNot Nothing Then - ' die Datei schliessen - ClassLogger.StreamWriter.Close() - ClassLogger.StreamWriter = Nothing - End If - End Sub - - - Public Shared Function CheckIsLogWritable() - - If ClassLogger.OpenFile Then - Try - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - Return False - End Try - Else - ClassLogger.ShowErrorMessage() - Return False - End If - - Return True - End Function - - - Public Shared Function CheckIsLogWritable(ByVal vDateiSpeicherort As String, ByVal vDateiPrefix As String) - - If ClassLogger.OpenFile(vDateiSpeicherort, vDateiPrefix) Then - Try - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - Return False - End Try - Else - ClassLogger.ShowErrorMessage() - Return False - End If - - Return True - End Function - - - Private Shared Sub ShowErrorMessage() - If Not ClassLogger.HasInformedAboutError Then - MsgBox("Beim Öffnen der Logdatei ist ein Fehler aufgetreten. Bitte stellen Sie sicher das Sie sowohl über entsprechende Schreibrechte im Verzeichnis, als auch über ausreichend Speicherplatz zum Speichern der Logdatei verfügen." & _ - vbNewLine & vbNewLine & "Es wird keine Logdatei angelegt oder beschrieben." & vbNewLine & vbNewLine & "Im folgenden werden Sie über Fehler, den Log betreffend nicht weiter informiert, um den Ablauf von " & My.Application.Info.ProductName & " nicht zu stören.", _ - MsgBoxStyle.Information, "Fehler beim Öffnen der Logdatei") - ClassLogger.HasInformedAboutError = True - End If - End Sub -End Class diff --git a/app/DD_PM_WINDREAM/ClassPMWindream.vb b/app/DD_PM_WINDREAM/ClassPMWindream.vb index c4d50f6..a28cb73 100644 --- a/app/DD_PM_WINDREAM/ClassPMWindream.vb +++ b/app/DD_PM_WINDREAM/ClassPMWindream.vb @@ -93,6 +93,7 @@ Public Class ClassPMWindream End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in GetValuesfromAuswahlliste:") Return Nothing End Try @@ -105,6 +106,7 @@ Public Class ClassPMWindream Dim vType = oAttribute.getVariableValue("dwAttrType") Return vType.ToString Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Return_Type:") Return "" End Try @@ -124,7 +126,7 @@ Public Class ClassPMWindream Dim i As Integer = 0 Dim indexname As String If aValues.Length = 1 And aValues(0) = "" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert ist leer/Nothing - Keine Indexierung", False) + LOGGER.Debug(" >> Indexwert ist leer/Nothing - Keine Indexierung", False) End If 'Jetzt jeden Indexwert durchlaufen For Each aName As String In Indizes @@ -143,7 +145,7 @@ Public Class ClassPMWindream 'If indexname = "Tournr" Then ' MsgBox("Index: " & indexname & vbNewLine & "wert: " & aValues(i), MsgBoxStyle.Information, "Index: " & aName.ToString) 'End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" ### Indexierung von Index: " & indexname & " ####", False) + LOGGER.Debug(" ### Indexierung von Index: " & indexname & " ####", False) 'MsgBox(oDocument.aName & vbNewLine & aValues(i) & vbNewLine & vType, MsgBoxStyle.Exclamation, "Zeile 87") Dim value = aValues(i) Dim convertValue @@ -153,13 +155,13 @@ Public Class ClassPMWindream Select Case vType 'Case WMObjectVariableValueTypeUndefined Case WMObjectVariableValueTypeString - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeString", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeString", False) convertValue = CStr(value) Case WMObjectVariableValueTypeInteger - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeInteger", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeInteger", False) If IsNumeric(value) = False Then frmValidator.idxerr_message = "Unerlaubte Eingabe in Numerisches Feld: " & value - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!", False) + LOGGER.Debug(" >> Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!", False) oDocument.Save() oDocument.unlock() Return False @@ -167,10 +169,11 @@ Public Class ClassPMWindream convertValue = CInt(value) _int = True Case WMObjectVariableValueTypeFloat - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False) Try convertValue = CDbl(value) Catch ex As Exception + LOGGER.Error(ex) frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!" oDocument.Save() oDocument.unlock() @@ -178,10 +181,11 @@ Public Class ClassPMWindream End Try Case WMObjectVariableValueTypeFixedPoint - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFixedPoint", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFixedPoint", False) Try convertValue = CDbl(value) Catch ex As Exception + LOGGER.Error(ex) frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!" oDocument.Save() oDocument.unlock() @@ -190,24 +194,24 @@ Public Class ClassPMWindream _dbl = True Case WMObjectVariableValueTypeBoolean - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeBoolean", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeBoolean", False) convertValue = CBool(value) _bool = True Case WMObjectVariableValueTypeDate - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeDate", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeDate", False) _date = True 'Dim _date As Date = value convertValue = value Case WMObjectVariableValueTypeTimeStamp - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTimeStamp", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTimeStamp", False) convertValue = CInt(value) Case WMObjectVariableValueTypeCurrency - ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeCurrency", False) + LOGGER.Info(" >> Typ des windream-Indexes: WMObjectVariableValueTypeCurrency", False) 'Wegen currency muß ein eigenes Objekt vom typ Variant erzeugt werden Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(value)) convertValue = aValueWrapper Case WMObjectVariableValueTypeTime - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTime", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTime", False) 'If ((value)) Then ' convertValue = CDate(value) 'Else @@ -216,44 +220,44 @@ Public Class ClassPMWindream 'Dim _date As Date = value convertValue = convertValue '*_date.ToShortTimeString Case WMObjectVariableValueTypeFloat - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False) convertValue = CStr(value) Case WMObjectVariableValueTypeVariant - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeVariant", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeVariant", False) convertValue = CStr(value) Case WMObjectVariableValueTypeFulltext - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFulltext", False) + LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFulltext", False) convertValue = CStr(value) Case 4100 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4100 Vektor Boolean", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 4100 Vektor Boolean", False) vektor = True Case 4101 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4101 Vektor Date", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 4101 Vektor Date", False) vektor = True Case 4104 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4104 Vektor Currency", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 4104 Vektor Currency", False) vektor = True Case 4097 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4097 Vektor alphanumerisch", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 4097 Vektor alphanumerisch", False) vektor = True Case 4098 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4098 Vektor Numerisch", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 4098 Vektor Numerisch", False) vektor = True Case 4099 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4099 Vektor Kommazahl", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 4099 Vektor Kommazahl", False) vektor = True Case 36865 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 36865 Vektor alphanumerisch", False) + LOGGER.Debug(" >> Typ des windream-Indexes: 36865 Vektor alphanumerisch", False) vektor = True Case Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes konnte nicht bestimmt werden!", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch des Auslesens (vType): " & vType) + LOGGER.Debug(" >> Typ des windream-Indexes konnte nicht bestimmt werden!", False) + LOGGER.Debug(" >> Versuch des Auslesens (vType): " & vType) 'MsgBox(vType & vbNewLine & CStr(value), MsgBoxStyle.Exclamation, "Marlon-Case Else") convertValue = "" End Select If vektor = False Then If convertValue.ToString Is Nothing = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Konvertierter Wert: '" & convertValue.ToString & "'", False) + LOGGER.Debug(" >> Konvertierter Wert: '" & convertValue.ToString & "'", False) End If End If '############################################################################################ @@ -262,9 +266,10 @@ Public Class ClassPMWindream If vektor = False Then If convertValue.ToString Is Nothing = False Then Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Jetzt indexieren: oDocument.SetVariableValue(" & aName & ", " & convertValue.ToString & ")", False) + LOGGER.Debug(" >> Jetzt indexieren: oDocument.SetVariableValue(" & aName & ", " & convertValue.ToString & ")", False) Catch ex As Exception - ClassLogger.Add(" >> Unexpected Error in Logging SetVariableValue for " & aName & ": " & ex.Message, False) + LOGGER.Error(ex) + LOGGER.Info(" >> Unexpected Error in Logging SetVariableValue for " & aName & ": " & ex.Message, False) End Try 'Dim ArrValues() @@ -285,13 +290,13 @@ Public Class ClassPMWindream Else oDocument.SetVariableValue(aName, convertValue) End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Index '" & aName & "' wurde geschrieben", False) + LOGGER.Debug(" >> Index '" & aName & "' wurde geschrieben", False) Else - ClassLogger.Add(" >> Kein Indexwert vorhanden", False) + LOGGER.Info(" >> Kein Indexwert vorhanden", False) End If Else 'VEKTORFELDER, ALSO ÜBERPRÜFEN OB ERGEBNIS-ARRAY GEFÜLLT IST - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> VEKTORFELD: Vorbereiten des Arrays", False) + LOGGER.Debug(" >> VEKTORFELD: Vorbereiten des Arrays", False) Dim myArray() 'Dim anz As Integer = 0 'For Each obj In aValues @@ -398,7 +403,7 @@ Public Class ClassPMWindream 'Jetzt die Nachindexierung für Vektor-Felder oDocument.SetVariableValue(aName, myArray) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> 'SetVariableValue' für VEKTOR erfolgreich", False) + LOGGER.Debug(" >> 'SetVariableValue' für VEKTOR erfolgreich", False) End If End If i += 1 @@ -410,21 +415,22 @@ Public Class ClassPMWindream 'SetRights(WMObject, User) oDocument.Save() oDocument.unlock() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" ### Indexierung erfolgreich beendet (Save und Unlock durchgeführt) ###", False) + LOGGER.Debug(" ### Indexierung erfolgreich beendet (Save und Unlock durchgeführt) ###", False) Return True Else - ClassLogger.Add(" ### Dokument ist gesperrt, Indexierung nicht möglich! ###", False) + LOGGER.Info(" ### Dokument ist gesperrt, Indexierung nicht möglich! ###", False) frmValidator.idxerr_message = "Dokument " & oDocument.aName & " ist gesperrt, Indexierung nicht möglich" Return False End If End If Catch ex As Exception - ClassLogger.Add("ClassSearchResult.RunIndexing - " & ex.Message, True) - frmValidator.idxerr_message = "Unvorhergesehener Fehler in Indexing: " & ex.Message & vbNewLine & "vType: " & vType.ToString - allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler beim Indexieren der Datei: " & oDocument.aName & " - ERROR: " & ex.Message, Environment.UserName) - oDocument.Save() - oDocument.unlock() - Return False + LOGGER.Error(ex) + LOGGER.Info("ClassSearchResult.RunIndexing - " & ex.Message, True) + frmValidator.idxerr_message = "Unvorhergesehener Fehler in Indexing: " & ex.Message & vbNewLine & "vType: " & vType.ToString + allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler beim Indexieren der Datei: " & oDocument.aName & " - ERROR: " & ex.Message, Environment.UserName) + oDocument.Save() + oDocument.unlock() + Return False End Try End Function @@ -445,29 +451,30 @@ Public Class ClassPMWindream Dim value = _state Dim convertValue 'Den Typ des Index-Feldes auslesen - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">> Typ des windream-Indexes: " & vType.ToString) + LOGGER.Debug(">> Typ des windream-Indexes: " & vType.ToString) Select Case (vType) Case WMObjectVariableValueTypeBoolean convertValue = CBool(value) Case Else - ClassLogger.Add(">> Typ des windream-Indexes ist nicht BOOLEAN also Abbruch:") + LOGGER.Info(">> Typ des windream-Indexes ist nicht BOOLEAN also Abbruch:") End Select '############################################################################################ '####################### Der eigentliche Indexierungsvorgang ################################ oDocument.SetVariableValue(Indexname, convertValue) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">> Index '" & Indexname & "' wurde gesetzt") + LOGGER.Debug(">> Index '" & Indexname & "' wurde gesetzt") oDocument.Save() oDocument.unlock() - ClassLogger.Add(">> DATEI wurde erfolgreich als fertig nachindexiert gekennzeichnet") + LOGGER.Info(">> DATEI wurde erfolgreich als fertig nachindexiert gekennzeichnet") Else - ClassLogger.Add(">> Dokument ist gesperrt, Indexierung erst im nächsten Durchlauf!") + LOGGER.Info(">> Dokument ist gesperrt, Indexierung erst im nächsten Durchlauf!") End If End If Catch ex As Exception - ClassLogger.Add("ClassSearchResult.SetfinalIndex - " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("ClassSearchResult.SetfinalIndex - " & ex.Message, True) 'If My.Settings.vNIMailsenden = True Then ' email.Send_EMail("Fehler bei SetfinalIndex - Datei: " & oDocument.aName.ToString & " - Fehler: " & ex.Message) 'End If @@ -486,12 +493,13 @@ Public Class ClassPMWindream Try wmsearch_exists = System.IO.File.Exists(WD_Search) Catch ex As Exception + LOGGER.Error(ex) wmsearch_exists = clsWM.CheckFileExists(WD_Search) End Try If wmsearch_exists = False Then - ClassLogger.Add(">> Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden! Die Datei '" & WD_Search & "' existiert nicht!", False) + LOGGER.Info(">> Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden! Die Datei '" & WD_Search & "' existiert nicht!", False) MsgBox("Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden!" & vbNewLine & "Die Datei '" & WD_Search & "' existiert nicht!", MsgBoxStyle.Exclamation, "Achtung:") 'wenn die gesuchte File eine Suche ist: per MAil informierne und Indexierung abbrechen 'If My.Settings.vNIMailsenden = True Then @@ -512,7 +520,8 @@ Public Class ClassPMWindream End If End If Catch ex As Exception - ClassLogger.Add(ex.Message) + LOGGER.Error(ex) + LOGGER.Info(ex.Message) Return 0 End Try @@ -572,7 +581,7 @@ Public Class ClassPMWindream oSearch = srchObjectType.GetSearch() Case Else - ClassLogger.Add("KEIN GÜLTIGER WINDREAM-SUCHTYP") + LOGGER.Info("KEIN GÜLTIGER WINDREAM-SUCHTYP") Return Nothing End Select Dim WMObjects As Object @@ -580,8 +589,9 @@ Public Class ClassPMWindream Return oSearch.execute Catch ex As Exception + LOGGER.Error(ex) ' bei einem Fehler einen Eintrag in der Logdatei machen - ClassLogger.Add("Fehler in GetSearchDocuments - " & ex.Message, True) + LOGGER.Info("Fehler in GetSearchDocuments - " & ex.Message, True) Return Nothing End Try @@ -602,6 +612,7 @@ Public Class ClassPMWindream IndexwertAusWindream = _dok.GetVariableValue(_indexname) Return IndexwertAusWindream.ToString Catch ex As Exception + LOGGER.Error(ex) 'MsgBox(ex.Message) Return Nothing End Try diff --git a/app/DD_PM_WINDREAM/ClassUser.vb b/app/DD_PM_WINDREAM/ClassUser.vb index eaef9ea..0e65ab7 100644 --- a/app/DD_PM_WINDREAM/ClassUser.vb +++ b/app/DD_PM_WINDREAM/ClassUser.vb @@ -5,7 +5,7 @@ Dim DT As DataTable = ClassDatabase.Return_Datatable(sel) If Not IsNothing(DT) Then If DT.Rows.Count = 1 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> User is in UM_ADMINS-Group....", False) + LOGGER.Debug(" >> User is in UM_ADMINS-Group....", False) Return True Else Return False @@ -15,6 +15,7 @@ End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Check_User_Exists_in_UMGroups:") Return False End Try diff --git a/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb b/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb index dcb1f68..3588f3d 100644 --- a/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb +++ b/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb @@ -51,12 +51,13 @@ Public Class ClassWindream_allgemein Try ' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen Me.oSession = CreateObject("Windream.WMSession", Me.GetCurrentServer) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> windream-Server: '" & Me.GetCurrentServer & "'", False) + LOGGER.Debug(" >> windream-Server: '" & Me.GetCurrentServer & "'", False) ' Connection-Objekt instanziieren Me.oConnect = CreateObject("Windream.WMConnect") 'MsgBox("windrem init 'ed") Catch ex As Exception - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($"Error while creating WMConnect Object: {vbCrLf}{ex.Message}", False) +LOGGER.Error(ex) + LOGGER.Debug($"Error while creating WMConnect Object: {vbCrLf}{ex.Message}", False) Return False End Try @@ -85,7 +86,7 @@ Public Class ClassWindream_allgemein End If If LOG_ERRORS_ONLY = False Then - ClassLogger.Add(" >> windream-Version: '" & oSession.GetSystemInfo("WindreamVersion") & "'", False) + LOGGER.Info(" >> windream-Version: '" & oSession.GetSystemInfo("WindreamVersion") & "'", False) End If ' AUSGABE VON SYSTEMINFORMATIONEN @@ -110,15 +111,17 @@ Public Class ClassWindream_allgemein ' Ordnertypen ausgelesen werden Me.oDokumentTypen = Me.oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument) Catch ex As Exception +LOGGER.Error(ex) Return False End Try End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> windream login successful", False) + LOGGER.Debug($" >> windream login successful", False) Return True Catch ex As Exception +LOGGER.Error(ex) If Err.Number = -2147220985 Then MsgBox("Die installierte windream-Version ist nicht ausreichend für den Betrieb der Tool Collection für windream." & vbNewLine & "Bitte kontaktieren Sie Digital Data." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & Err.Description, MsgBoxStyle.Exclamation, "Unzureichende windream-Version") @@ -139,7 +142,7 @@ Public Class ClassWindream_allgemein If WMSESSION_STARTSTOP_STARTUP = True Then 'And userExistsInServerUserGroup Is Nothing - ClassLogger.Add(">> WINDREAM-Start on ApplicationStart is active!", False) + LOGGER.Info(">> WINDREAM-Start on ApplicationStart is active!", False) Dim owindreamControlCenter = CreateObject("Wmcc.ControlCenter") Dim owindreamIndexService = CreateObject("WMIndexServer.WMIdxSvControl") @@ -150,7 +153,8 @@ Public Class ClassWindream_allgemein End If Create_Session() Catch ex As Exception - ClassLogger.Add("Error while starting up WMCC and IndexService: " & ex.Message, True) +LOGGER.Error(ex) + LOGGER.Info("Error while starting up WMCC and IndexService: " & ex.Message, True) End Try End Function Public Function Stop_WMCC_andCo() @@ -169,7 +173,8 @@ Public Class ClassWindream_allgemein owindreamControlCenter.ExitCC(0) End If Catch ex As Exception - ClassLogger.Add("Error while Stopping WMCC and IndexService: " & ex.Message, True) +LOGGER.Error(ex) + LOGGER.Info("Error while Stopping WMCC and IndexService: " & ex.Message, True) End Try End Function #End Region @@ -189,6 +194,7 @@ Public Class ClassWindream_allgemein Return Me.oDokumentTypen Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen der Objekttypen") Return Nothing End Try @@ -211,6 +217,7 @@ Public Class ClassWindream_allgemein Return objektTypenStr Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen der Objekttypen als String") Return Nothing End Try @@ -222,6 +229,7 @@ Public Class ClassWindream_allgemein Dim vType = oAttribute.getVariableValue("dwAttrType") Return vType Catch ex As Exception +LOGGER.Error(ex) Return Nothing End Try @@ -256,6 +264,7 @@ Public Class ClassWindream_allgemein WMObject = oSession.GetWMObjectByPath(WINDREAMLib.WMEntity.WMEntityDocument, oNormalizedPath) Return True Catch ex As Exception +LOGGER.Error(ex) Return False End Try End Function @@ -303,6 +312,7 @@ Public Class ClassWindream_allgemein Return aIndexNames Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen der windream-Indexe") Return Nothing End Try @@ -328,6 +338,7 @@ Public Class ClassWindream_allgemein Return Nothing Catch ex As Exception +LOGGER.Error(ex) MsgBox("Es konnte ein Objekttyp nicht erstellt werden." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Exclamation, "Objekttyp konnte nicht erstellt werden") Return Nothing End Try @@ -351,6 +362,7 @@ Public Class ClassWindream_allgemein Next Catch ex As Exception +LOGGER.Error(ex) MsgBox("Beim Prüfen ob ein Index für einen Objekttypen existiert, ist ein Fehler aufgetreten." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Prüfen auf Existenz eines Index in einem Objekttyp") End Try @@ -373,6 +385,7 @@ Public Class ClassWindream_allgemein Try Return Me.oSession.aLoggedin Catch ex As Exception +LOGGER.Error(ex) MsgBox("Es konnte nicht erfolgreich geprüft werden, ob das Programm am windream-Server angemeldted ist." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei Loggedin-Prüfung") End Try @@ -388,6 +401,7 @@ Public Class ClassWindream_allgemein Try Return Me.oBrowser.GetCurrentServer 'ClassWindream.oBrowser.GetCurrentServer Catch ex As Exception +LOGGER.Error(ex) MsgBox("Der aktuell gewählte windream-Server konnte nicht ausgelesen werden." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen des windream-Servers") End Try @@ -468,6 +482,7 @@ Public Class ClassWindream_allgemein End If Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in GetValuesfromAuswahlliste:") Return Nothing End Try diff --git a/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj b/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj index 2907c34..1bd8e31 100644 --- a/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj +++ b/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj @@ -204,7 +204,6 @@ - diff --git a/app/DD_PM_WINDREAM/ModuleHelperMethods.vb b/app/DD_PM_WINDREAM/ModuleHelperMethods.vb index 52af98e..5e290b9 100644 --- a/app/DD_PM_WINDREAM/ModuleHelperMethods.vb +++ b/app/DD_PM_WINDREAM/ModuleHelperMethods.vb @@ -24,6 +24,7 @@ Try result = Convert.ToBoolean(str) Catch ex As Exception + LOGGER.Error(ex) result = False End Try diff --git a/app/DD_PM_WINDREAM/ModuleMySettings.vb b/app/DD_PM_WINDREAM/ModuleMySettings.vb index 4d49caf..12452da 100644 --- a/app/DD_PM_WINDREAM/ModuleMySettings.vb +++ b/app/DD_PM_WINDREAM/ModuleMySettings.vb @@ -73,7 +73,8 @@ Module ModuleMySettings Try PWplainText = wrapper.DecryptData(oBuilder.Password) Catch ex As Exception - ClassLogger.Add("- the Password '" & oBuilder.Password & "' could not be decrypted", False) + LOGGER.Error(ex) + LOGGER.Info("- the Password '" & oBuilder.Password & "' could not be decrypted", False) PWplainText = oBuilder.Password End Try oConnectionString = oRow.Item("Value").ToString.Replace(oBuilder.Password, PWplainText) @@ -111,6 +112,7 @@ Module ModuleMySettings Next Return True Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in LoadMyConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return False End Try @@ -121,6 +123,7 @@ Module ModuleMySettings oDataset.ReadXml(ConfigPath) Return oDataset.Tables(0) Catch ex As Exception + LOGGER.Error(ex) Dim oDataTable = CreateConfigTable() oDataTable.WriteXml(GetUserConfigPath()) MsgBox("Fehler beim Laden der Konfiguration. Es wurde die Standard Konfiguration geladen. Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) @@ -192,6 +195,7 @@ Module ModuleMySettings oTable.AcceptChanges() Return oTable Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in CreateConfigTable" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return Nothing End Try @@ -216,6 +220,7 @@ Module ModuleMySettings oDatatable.WriteXml(oUserConfigPath) Return True Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in SaveConfigValue" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return False End Try diff --git a/app/DD_PM_WINDREAM/clsPatterns.vb b/app/DD_PM_WINDREAM/clsPatterns.vb index f175393..f1ebdc3 100644 --- a/app/DD_PM_WINDREAM/clsPatterns.vb +++ b/app/DD_PM_WINDREAM/clsPatterns.vb @@ -55,7 +55,8 @@ Public Class clsPatterns Return result Catch ex As Exception - ClassLogger.Add("Error in ReplaceAllValues:" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in ReplaceAllValues:" & ex.Message) End Try End Function @@ -80,7 +81,8 @@ Public Class clsPatterns Return result Catch ex As Exception - ClassLogger.Add("Error in ReplaceInternalValues:" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in ReplaceInternalValues:" & ex.Message) End Try End Function @@ -107,7 +109,8 @@ Public Class clsPatterns Return result Catch ex As Exception - ClassLogger.Add("Error in ReplaceUserValues:" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in ReplaceUserValues:" & ex.Message) End Try End Function @@ -128,7 +131,8 @@ Public Class clsPatterns Return result Catch ex As Exception - ClassLogger.Add("Error in ReplaceControlValues:" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in ReplaceControlValues:" & ex.Message) End Try End Function @@ -147,7 +151,8 @@ Public Class clsPatterns Return result Catch ex As Exception - ClassLogger.Add("Error in ReplaceWindreamIndicies:" & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in ReplaceWindreamIndicies:" & ex.Message) End Try End Function diff --git a/app/DD_PM_WINDREAM/frmAdminPasswort.vb b/app/DD_PM_WINDREAM/frmAdminPasswort.vb index c31a5f9..88740ae 100644 --- a/app/DD_PM_WINDREAM/frmAdminPasswort.vb +++ b/app/DD_PM_WINDREAM/frmAdminPasswort.vb @@ -8,6 +8,7 @@ Public Class frmAdminPasswort Me.TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = CONNECTION_STRING akt_pw = TBPM_KONFIGURATIONTableAdapter.cmdGetAdminPW Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Form Load:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try diff --git a/app/DD_PM_WINDREAM/frmAdministration.vb b/app/DD_PM_WINDREAM/frmAdministration.vb index 1012067..0230e40 100644 --- a/app/DD_PM_WINDREAM/frmAdministration.vb +++ b/app/DD_PM_WINDREAM/frmAdministration.vb @@ -54,6 +54,7 @@ Public Class frmAdministration tabctrl_Profilkonfig.SelectedIndex = 0 Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Laden der Wertehilfen und Konfig-Daten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -63,6 +64,7 @@ Public Class frmAdministration 'Windream initialisieren (Connection, Session, ... aufbauen) '_windreamPM.Create_Session() Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try ObjekttypenEintragen() @@ -79,6 +81,7 @@ Public Class frmAdministration Next End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Indexe_eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try End Sub @@ -119,6 +122,7 @@ Public Class frmAdministration cmbLOGIndex.SelectedIndex = -1 End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Indexe_eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") PM_VEKTOR_INDEXComboBox.SelectedIndex = -1 cmbLOGIndex.SelectedIndex = -1 @@ -145,6 +149,7 @@ Public Class frmAdministration End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Refresh_Profildaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -158,6 +163,7 @@ Public Class frmAdministration Me.cmbObjekttypen.Items.Add(aType.aName) Next Catch ex As Exception +LOGGER.Error(ex) MsgBox("Es konnte keine Verbindung zum windream-Server hergestellt werden.", MsgBoxStyle.Critical, "Fehler beim Zugriff auf windream-Server") End Try @@ -184,6 +190,7 @@ Public Class frmAdministration p.Close() End If Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei öffnen der windream-Suche:") End Try End Sub @@ -198,6 +205,7 @@ Public Class frmAdministration tstrlblSave.Visible = False End If Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Speichern des Profils:") End Try @@ -267,6 +275,7 @@ Public Class frmAdministration End If Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der User zu Profil:") End Try End Sub @@ -295,6 +304,7 @@ Public Class frmAdministration FillProfile_User(profileId) End If Catch ex As Exception +LOGGER.Error(ex) MsgBox($"Error while calling FillProfile_User", MsgBoxStyle.Critical) End Try End If @@ -308,6 +318,7 @@ Public Class frmAdministration TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, Environment.UserName) FillProfile_User(profileId) Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:") End Try End Sub @@ -321,6 +332,7 @@ Public Class frmAdministration TBPROFILE_USERTableAdapter.CmdDelete(profileId, userId) FillProfile_User(profileId) Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen eines Users:") End Try End Sub @@ -336,6 +348,7 @@ Public Class frmAdministration ' TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, Environment.UserName) FillProfile_User(profileId) Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen einer Gruppe:") End Try End Sub @@ -351,6 +364,7 @@ Public Class frmAdministration 'TBPROFILE_USERTableAdapter.cmdDelete(userId) FillProfile_User(profileId) Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen einer Gruppe:") End Try End Sub @@ -429,6 +443,7 @@ Public Class frmAdministration TBPM_ERROR_LOGTableAdapter.CmdDelete() Refresh_log() Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Delete Log:") End Try End Sub @@ -436,6 +451,7 @@ Public Class frmAdministration Try Me.TBPM_ERROR_LOGTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_ERROR_LOG) Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Refresh Error:") End Try End Sub @@ -625,6 +641,7 @@ Public Class frmAdministration Refresh_Profildaten() End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Anlage Profilkopie:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:") End Try @@ -640,6 +657,7 @@ Public Class frmAdministration SQLconnection.Close() Return True Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler in Execute_SQL: " & vbNewLine & ex.Message & vbNewLine & vbNewLine & " SQL: " & SQL) Return False End Try @@ -662,6 +680,7 @@ Public Class frmAdministration MsgBox("Das Profil " & NAMETextBox.Text & " wurde erfolgreich gelöscht!", MsgBoxStyle.Information, "Erfolgsmeldung") Refresh_Profildaten() Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Löschen des Profils:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:") End Try @@ -726,6 +745,7 @@ Public Class frmAdministration Try Me.TBDD_USERTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBDD_USER) Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei LoadUsers: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:") End Try End Sub @@ -903,6 +923,7 @@ Public Class frmAdministration Process.Start(USER_MANAGER_PATH) End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error while startign User Manager:" & vbCrLf & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -992,8 +1013,9 @@ Public Class frmAdministration PropertyGrid1.SelectedObject = obj PropertyGrid1.Refresh() Catch ex As Exception +LOGGER.Error(ex) MsgBox($"Error while loading Final Index properties: {ex.Message}") - ClassLogger.Add($"Error while loading Final Index properties: {ex.Message}") + LOGGER.Info($"Error while loading Final Index properties: {ex.Message}") End Try End Sub @@ -1066,8 +1088,9 @@ Public Class frmAdministration Refresh_Final_indexe() End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error while Saving Final Index: " & ex.Message, MsgBoxStyle.Critical) - ClassLogger.Add("Error while Saving Final Index: " & ex.Message) + LOGGER.Info("Error while Saving Final Index: " & ex.Message) Finally tsBtnCancel.Visible = False BindingNavigatorAddNewItem.Visible = True diff --git a/app/DD_PM_WINDREAM/frmAnnotations.vb b/app/DD_PM_WINDREAM/frmAnnotations.vb index ffe7e48..3ee4b9a 100644 --- a/app/DD_PM_WINDREAM/frmAnnotations.vb +++ b/app/DD_PM_WINDREAM/frmAnnotations.vb @@ -11,6 +11,7 @@ Public Class frmAnnotations Me.Cursor = Cursors.Default Me.Close() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical) Me.Cursor = Cursors.Default End Try diff --git a/app/DD_PM_WINDREAM/frmClientLogin.vb b/app/DD_PM_WINDREAM/frmClientLogin.vb index f84a695..49d4c4c 100644 --- a/app/DD_PM_WINDREAM/frmClientLogin.vb +++ b/app/DD_PM_WINDREAM/frmClientLogin.vb @@ -13,6 +13,7 @@ cmbClients.DisplayMember = DT_CLIENT_USER.Columns("CLIENT_NAME").ColumnName cmbClients.ValueMember = DT_CLIENT_USER.Columns("CLIENT_ID").ColumnName Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unexpected Error in Loading Data: " & ex.Message, MsgBoxStyle.Critical) End Try End Sub diff --git a/app/DD_PM_WINDREAM/frmConnection.vb b/app/DD_PM_WINDREAM/frmConnection.vb index d31caaf..f1e3b51 100644 --- a/app/DD_PM_WINDREAM/frmConnection.vb +++ b/app/DD_PM_WINDREAM/frmConnection.vb @@ -125,6 +125,7 @@ Public Class frmConnection MsgBox("Die Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:") Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message & vbNewLine & vbNewLine & connstr, MsgBoxStyle.Critical, "Fehler bei Verbindungsaufbau Oracle:") End Try Case Else @@ -133,6 +134,7 @@ Public Class frmConnection End If Catch ex As Exception + LOGGER.Error(ex) Cursor = Cursors.Default Dim template As String = ex.Message MsgBox("Fehler beim Verbindungsaufbau: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) @@ -149,6 +151,7 @@ Public Class frmConnection MsgBox("Änderungen wurden erfolgreich gespeichert!", MsgBoxStyle.Information) End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler beim Speichern: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try @@ -159,6 +162,7 @@ Public Class frmConnection load_connections() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Laden der Grunddaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -168,6 +172,7 @@ Public Class frmConnection Me.TBDD_CONNECTIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBDD_CONNECTION) TBDD_CONNECTIONDataGridView.AutoResizeColumns() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Connections laden: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -259,6 +264,7 @@ Public Class frmConnection 'End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Löschen Connection: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -321,6 +327,7 @@ Public Class frmConnection connection.Close() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error while loading Databases. Default Database will be set!" & vbCrLf & ex.Message, MsgBoxStyle.Critical) DD_LIB_Standards.clsLogger.Add("Error while loading Databases:" & ex.Message) Finally diff --git a/app/DD_PM_WINDREAM/frmControl_Detail.vb b/app/DD_PM_WINDREAM/frmControl_Detail.vb index b9573d9..4f7e813 100644 --- a/app/DD_PM_WINDREAM/frmControl_Detail.vb +++ b/app/DD_PM_WINDREAM/frmControl_Detail.vb @@ -31,6 +31,7 @@ Public Class frmControl_Detail tslblAenderungen.Visible = False End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Speichern:") End Try @@ -49,6 +50,7 @@ Public Class frmControl_Detail End If Me.TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der Formulardaten:") End Try diff --git a/app/DD_PM_WINDREAM/frmFileInfo.vb b/app/DD_PM_WINDREAM/frmFileInfo.vb index b7fb5e2..051c3be 100644 --- a/app/DD_PM_WINDREAM/frmFileInfo.vb +++ b/app/DD_PM_WINDREAM/frmFileInfo.vb @@ -8,6 +8,7 @@ txtLocation.Text = CURRENT_DOC_PATH txtCreation.Text = CURRENT_DOC_CREATION_DATE Catch ex As Exception + LOGGER.Error(ex) End Try End Sub diff --git a/app/DD_PM_WINDREAM/frmFormDesigner.vb b/app/DD_PM_WINDREAM/frmFormDesigner.vb index e5ef667..95731c5 100644 --- a/app/DD_PM_WINDREAM/frmFormDesigner.vb +++ b/app/DD_PM_WINDREAM/frmFormDesigner.vb @@ -53,6 +53,7 @@ Public Class frmFormDesigner Windream_ChoiceLists.Add(String.Empty) Windream_ChoiceLists.AddRange(clsWD_GET.GetChoiceLists()) Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -63,11 +64,13 @@ Public Class frmFormDesigner TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING TBDD_CONNECTIONTableAdapter.Fill(DD_DMSLiteDataSet.TBDD_CONNECTION) Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Laden der Connection-Strings und Grunddaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try LoadControls() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "error loading form:") End Try End Sub @@ -193,6 +196,7 @@ Public Class frmFormDesigner End Select Next Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei LoadControls " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -204,6 +208,7 @@ Public Class frmFormDesigner Try TBPM_PROFILE_CONTROLSBindingSource.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try End Sub @@ -343,8 +348,9 @@ Public Class frmFormDesigner pnldesigner.Controls.Add(line) End Select Catch ex As Exception - ClassLogger.Add($"Error while Adding new control {e.Data.GetData(DataFormats.Text)}:") - ClassLogger.Add(ex) + LOGGER.Error(ex) + LOGGER.Info($"Error while Adding new control {e.Data.GetData(DataFormats.Text)}:") + LOGGER.Info(ex) End Try End Sub @@ -412,6 +418,7 @@ Public Class frmFormDesigner frmTableColumn.Show() End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -432,6 +439,7 @@ Public Class frmFormDesigner frmTableColumn.Text = "Konfiguration von Spalte: " & dgvColumn.Name frmTableColumn.Show() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -449,6 +457,7 @@ Public Class frmFormDesigner End If End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "DeleteControl:") End Try End Sub @@ -609,6 +618,7 @@ Public Class frmFormDesigner End If End If Catch ex As Exception + LOGGER.Error(ex) Mouse_IsMoving = False End Try End Sub @@ -674,8 +684,9 @@ Public Class frmFormDesigner Try TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, ProfileId) Catch ex As Exception - ClassLogger.Add("Error while executing TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil in LoadControlProperties:") - ClassLogger.Add(ex) + LOGGER.Error(ex) + LOGGER.Info("Error while executing TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil in LoadControlProperties:") + LOGGER.Info(ex) End Try row = dt.AsEnumerable().Where(Function(r As DataRow) @@ -684,7 +695,7 @@ Public Class frmFormDesigner ' Control-Id wurde nicht in DataRow gefunden If IsNothing(row) Then - ClassLogger.Add($"Error while filtering Controls by Guid '{sender.Tag}' in LoadControlProperties:") + LOGGER.Info($"Error while filtering Controls by Guid '{sender.Tag}' in LoadControlProperties:") MsgBox($"Control mit der Id {sender.Tag} wurde nicht gefunden!", MsgBoxStyle.Critical, "Fehler beim Laden der Control Eigenschaften") Exit Sub @@ -877,9 +888,10 @@ Public Class frmFormDesigner Catch ex As Exception + LOGGER.Error(ex) Dim msg = $"UpdateSingleValue - Fehler beim Speichern von Control (Id: {guid}, column: {columnName}): {vbCrLf}{ex.Message}" MsgBox(msg) - ClassLogger.Add(msg) + LOGGER.Info(msg) End Try End Sub End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmKonfig.vb b/app/DD_PM_WINDREAM/frmKonfig.vb index 72f7b3d..880201a 100644 --- a/app/DD_PM_WINDREAM/frmKonfig.vb +++ b/app/DD_PM_WINDREAM/frmKonfig.vb @@ -46,6 +46,7 @@ Public Class frmKonfig Me.txtpdfxchange.Text = VIEWER_XCHANGE Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Formload Grundkonfig:") End Try End Sub @@ -112,6 +113,7 @@ Public Class frmKonfig End If connection.Close() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Datenbank-Connect:") End Try Cursor = Cursors.Default @@ -119,14 +121,14 @@ Public Class frmKonfig Private Sub BtnConnect_Click(sender As System.Object, e As System.EventArgs) Handles BtnConnect.Click Try - Dim con As String + Dim oPlainConnectionString, oEncryptedConnectionString As String If chkbxUserAut.Checked Then - con = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;" + oPlainConnectionString = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;" Else - con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" + oPlainConnectionString = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" End If - Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString) + Dim connection As New SqlClient.SqlConnection(oPlainConnectionString) 'csb.ConnectionString) 'während Verbindungsaufbau Sanduhr-Mauszeiger Cursor = Cursors.WaitCursor connection.Open() @@ -136,21 +138,23 @@ Public Class frmKonfig result = MessageBox.Show("Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?", "Erfolgsmeldung:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If result = MsgBoxResult.Yes Then 'ConnectionString in Anwendung speichern - CONNECTION_STRING = con + CONNECTION_STRING = oPlainConnectionString ClassDatabase.Init() 'Das Passwort verschlüsseln If chkbxUserAut.Checked = False Then Dim wrapper As New ClassEncryption("!35452didalog=") Dim cipherText As String = wrapper.EncryptData(Me.txtPasswort.Text) Dim pw As String = cipherText - con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";" + oEncryptedConnectionString = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";" + Else + oEncryptedConnectionString = oPlainConnectionString End If 'SaveMySettingsValue("MyConnectionString", con) 'My.Settings.Save() - CONNECTION_STRING = con - CONFIG.Config.ConnectionString = con + CONNECTION_STRING = oPlainConnectionString + CONFIG.Config.ConnectionString = oEncryptedConnectionString CONFIG.Save() Load_ConString(CONNECTION_STRING) @@ -158,6 +162,7 @@ Public Class frmKonfig Me.TBPM_KONFIGURATIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_KONFIGURATION) End If Catch ex As Exception + LOGGER.Error(ex) Cursor = Cursors.Default MsgBox("Fehler beim Verbindungsaufbau: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try @@ -198,7 +203,6 @@ Public Class frmKonfig End If Case "system" rbSystem.Checked = True - End Select End Sub @@ -267,7 +271,6 @@ Public Class frmKonfig Me.Validate() Me.TBPM_KONFIGURATIONBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.DD_DMSLiteDataSet) - End Sub Private Sub Button1_Click_3(sender As Object, e As EventArgs) Handles Button1.Click @@ -338,7 +341,8 @@ Public Class frmKonfig End Sub Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnopenlog.Click - Process.Start(ClassLogger.DateiSpeicherort) + 'Process.Start(ClassLogger.DateiSpeicherort) + Process.Start(LOGCONFIG.LogDirectory) End Sub Private Sub txtIntervall_TextChanged(sender As Object, e As EventArgs) Handles txtIntervall.TextChanged @@ -348,6 +352,7 @@ Public Class frmKonfig Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged LOG_ERRORS_ONLY = chkLogErrorsOnly.Checked + LOGCONFIG.Debug = Not LOG_ERRORS_ONLY CONFIG.Config.LogErrorsOnly = LOG_ERRORS_ONLY CONFIG.Save() 'SaveMySettingsValue("LogErrorsOnly", chkLogErrorsOnly.Checked) diff --git a/app/DD_PM_WINDREAM/frmLicense.vb b/app/DD_PM_WINDREAM/frmLicense.vb index bf25789..ee94bf4 100644 --- a/app/DD_PM_WINDREAM/frmLicense.vb +++ b/app/DD_PM_WINDREAM/frmLicense.vb @@ -31,6 +31,7 @@ Public Class frmLicense 'MsgBox("Die Lizenzen wurden erfolgreich aktualisiert!", MsgBoxStyle.Exclamation, "Erfolgsmeldung:") End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei New Licenses:") End Try End Sub @@ -51,6 +52,7 @@ Public Class frmLicense Try dtp_Gültigkeit.Value = CDate(split(1)) Catch ex As Exception + LOGGER.Error(ex) Dim oLicDateString As String = split(1) Dim cultureInfo As System.Globalization.CultureInfo cultureInfo = New System.Globalization.CultureInfo("de-DE") @@ -75,6 +77,7 @@ Public Class frmLicense End If End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unexpected error in LicenseManager-RefreshLicense:") End Try End Sub @@ -83,6 +86,7 @@ Public Class frmLicense Try TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = CONNECTION_STRING Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Formular Load:") End Try End Sub diff --git a/app/DD_PM_WINDREAM/frmLoginAdmin.vb b/app/DD_PM_WINDREAM/frmLoginAdmin.vb index d099a60..928291f 100644 --- a/app/DD_PM_WINDREAM/frmLoginAdmin.vb +++ b/app/DD_PM_WINDREAM/frmLoginAdmin.vb @@ -9,6 +9,7 @@ Public Class frmLoginAdmin Me.txtPW.Focus() Me.txtPW.Text = "" Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Form Load:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -54,6 +55,7 @@ Public Class frmLoginAdmin frmAdminPasswort.ShowDialog() akt_pw = TBPM_KONFIGURATIONTableAdapter.cmdGetAdminPW Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Admin PW:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try diff --git a/app/DD_PM_WINDREAM/frmMain.vb b/app/DD_PM_WINDREAM/frmMain.vb index 43e63e4..5534833 100644 --- a/app/DD_PM_WINDREAM/frmMain.vb +++ b/app/DD_PM_WINDREAM/frmMain.vb @@ -33,7 +33,8 @@ Public Class frmMain My.Settings.Save() SaveGridLayout() Catch ex As Exception - ClassLogger.Add("Error in Save FormLayout: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in Save FormLayout: " & ex.Message) End Try If WINDREAM?.oSession?.aLoggedin = True Then WINDREAM.Stop_WMCC_andCo() @@ -44,11 +45,12 @@ Public Class frmMain Try ClassAllgemeineFunktionen.LoginOut("LOGOUT") - ClassLogger.Add("## ProcessManager beendet - " & Now, False) - ClassLogger.Add("", False) + LOGGER.Info("## ProcessManager beendet - " & Now, False) + LOGGER.Info("", False) Catch ex As Exception - ClassLogger.Add("### Fehler bei LogOut") - ClassLogger.Add("### Fehler: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("### Fehler bei LogOut") + LOGGER.Info("### Fehler: " & ex.Message) End Try End Sub @@ -60,10 +62,11 @@ Public Class frmMain End Sub Private Sub frmMain_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Initializing MainForm....", False) + LOGGER.Debug(" >> Initializing MainForm....", False) Try UserLookAndFeel.Default.SetSkinStyle("VS2010") Catch ex As Exception + LOGGER.Error(ex) End Try @@ -74,18 +77,19 @@ Public Class frmMain End If Try If CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName = "eng" Then - ClassLogger.Add("## CurrentUICulture.Name: " & CultureInfo.CurrentUICulture.Name, False) + LOGGER.Info("## CurrentUICulture.Name: " & CultureInfo.CurrentUICulture.Name, False) INDEX_DMS_ERSTELLT = "DMS Created" INDEX_DMS_ERSTELLT_ZEIT = "DMS Created Time" My.Settings.Save() End If Catch ex As Exception + LOGGER.Error(ex) MessageBox.Show("Fehler bei Laden der CurrentUICulture-Info!", "Achtung:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Try If Refresh_ConnectionString() = True Then Try tslblLicenses.Text = "Anzahl Lizenzen: " & LICENSE_COUNT - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Initializing MainForm....", False) + LOGGER.Debug(" >> Initializing MainForm....", False) If ERROR_STATE = "NO USER" Then MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt!" & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") Me.Close() @@ -95,7 +99,7 @@ Public Class frmMain Me.Close() End If Else - ClassLogger.Add(">> Username: " & Environment.UserName, False) + LOGGER.Info(">> Username: " & Environment.UserName, False) 'Wenn license abgelaufen und der User nicht admin ist! If LICENSE_EXPIRED = True Then If USER_IS_ADMIN = False Then @@ -113,6 +117,7 @@ Public Class frmMain tslblUserLoggedin.Text = "Anzahl User eingeloggt: " & USERCOUNT_LOGGED_IN End If Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei User Check:") End Try @@ -121,6 +126,7 @@ Public Class frmMain Decide_Load() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Laden des Formulars: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -133,6 +139,7 @@ Public Class frmMain TimerRefresh.Start() End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unexpected Error in LoadForm - Step 4: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") End Try @@ -151,10 +158,11 @@ Public Class frmMain Me.Close() End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unexpected Error in windream-login - Step 5: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") End Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> MainForm initialized!", False) + LOGGER.Debug(" >> MainForm initialized!", False) End If End Sub @@ -169,6 +177,7 @@ Public Class frmMain TimerReminder.Stop() End If Catch ex As Exception + LOGGER.Error(ex) End Try @@ -188,7 +197,8 @@ Public Class frmMain Me.Size = My.Settings.frmMainSize End If Catch ex As Exception - ClassLogger.Add("Error in Load FormLayout: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in Load FormLayout: " & ex.Message) End Try End Sub Function Refresh_ConnectionString() @@ -200,6 +210,7 @@ Public Class frmMain Return True Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Refresh_ConnectionString:") Return False End Try @@ -217,7 +228,8 @@ Public Class frmMain Dim xml As String = GetXML_LayoutName() GridView_Docs.SaveLayoutToXml(xml, OptionsLayoutBase.FullLayout) Catch ex As Exception - ClassLogger.Add("Error while saving GridLayout: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error while saving GridLayout: " & ex.Message) End Try End Sub @@ -230,7 +242,8 @@ Public Class frmMain Dim xml As String = GetXML_LayoutName() GridView_Docs.RestoreLayoutFromXml(xml, OptionsLayoutBase.FullLayout) Catch ex As Exception - ClassLogger.Add("Error while restoring layout: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error while restoring layout: " & ex.Message) End Try End Sub @@ -258,7 +271,8 @@ Public Class frmMain End If Catch ex As Exception - ClassLogger.Add("Error while resetting layout: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error while resetting layout: " & ex.Message) End Try End Sub @@ -273,7 +287,8 @@ Public Class frmMain CurrGroup.ItemLinks.Clear() Catch ex As Exception - ClassLogger.Add("CurrGroupClear - Error: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("CurrGroupClear - Error: " & ex.Message) End Try @@ -303,7 +318,8 @@ Public Class frmMain CurrGroup.Expanded = profileGroupOpen Catch ex As Exception - ClassLogger.Add("Load_Profile_items - Error: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Load_Profile_items - Error: " & ex.Message) MsgBox("Unexpected Error in Load_Profile_items - Error: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try Cursor = Cursors.Default @@ -342,7 +358,8 @@ Public Class frmMain Return True Catch ex As Exception - ClassLogger.Add("Load_Profiles_for_User - Error: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Load_Profiles_for_User - Error: " & ex.Message) Return False End Try End Function @@ -396,6 +413,7 @@ Public Class frmMain Try chart.Series.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try ' Set DataSource @@ -439,6 +457,7 @@ Public Class frmMain Try chart.Series.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try ' Set DataSource @@ -459,7 +478,8 @@ Public Class frmMain End If End If Catch ex As Exception - ClassLogger.Add("Layout Dashboard - Error: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Layout Dashboard - Error: " & ex.Message) MsgBox("Unexpected Error in Layout Dashboard - Error: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -555,7 +575,8 @@ Public Class frmMain End If Catch ex As Exception - ClassLogger.Add("Load_single_Profile - Error: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Load_single_Profile - Error: " & ex.Message) End Try End Sub @@ -565,6 +586,7 @@ Public Class frmMain Try GridView_Docs.Columns.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try @@ -640,6 +662,7 @@ Public Class frmMain Columns_Removed = True GRID_INV_COL_REMOVED = True Catch ex As Exception + LOGGER.Error(ex) End Try @@ -648,7 +671,8 @@ Public Class frmMain Next Return Columns_Removed Catch ex As Exception - ClassLogger.Add("Unexpected Error in GridView_CheckInvalidColumns: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in GridView_CheckInvalidColumns: " & ex.Message) End Try End Function Sub LoadProfile_PM() @@ -692,14 +716,15 @@ Public Class frmMain GridView_Docs.OptionsBehavior.AutoExpandAllGroups = True GridView_Docs.OptionsView.ShowGroupedColumns = False Catch ex As Exception - ClassLogger.Add("Unexpected Error in Formatting Grid: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Formatting Grid: " & ex.Message) End Try Dim Columns_Removed = GridView_CheckInvalidColumns() RestoreLayout() If GridView_Docs.Columns.Count <= 2 Then - ClassLogger.Add("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False) + LOGGER.Info("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False) Reset_GridLayout() End If @@ -708,12 +733,14 @@ Public Class frmMain Try GridView_Docs.Columns.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try End If End If Catch ex As Exception - ClassLogger.Add("LoadProfile_PM - Fehler: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("LoadProfile_PM - Fehler: " & ex.Message) MsgBox("Fehler LoadProfile_PM - Fehler: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -725,6 +752,7 @@ Public Class frmMain ' Load_Profil() Check_Timer_Notification() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden Grundeinstellungen:") End Try @@ -740,7 +768,7 @@ Public Class frmMain Load_Profile_items() Decide_Load() tsslblLastSysnc.Text = "Letzte Synchronisation: " & Now.ToLongTimeString - + End Sub Private Sub NotifyIcon1_Click(sender As System.Object, e As System.EventArgs) Handles NotifyIcon1.Click @@ -761,7 +789,8 @@ Public Class frmMain Load_single_Profile() End If Catch ex As Exception - ClassLogger.Add("Unexpected error in Decide_load: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected error in Decide_load: " & ex.Message) End Try If TimerRefresh.Enabled = False Then TimerRefresh.Start() @@ -798,13 +827,15 @@ Public Class frmMain Try splash.ShowDialog() Catch ex As Exception - ClassLogger.Add($"Error in Splash: {ex.Message}") + LOGGER.Error(ex) + LOGGER.Info($"Error in Splash: {ex.Message}") End Try Try InitializeComponent() ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. Catch ex As Exception - ClassLogger.Add($"Error in InitializeComponent: {ex.Message}") + LOGGER.Error(ex) + LOGGER.Info($"Error in InitializeComponent: {ex.Message}") End Try @@ -833,6 +864,7 @@ Public Class frmMain frmValidator.ShowDialog() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical) End Try Me.Visible = True @@ -942,6 +974,7 @@ Public Class frmMain End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unexpected error in Item_Scope: " & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -954,11 +987,12 @@ Public Class frmMain WINDREAM = New ClassPMWindream() WINDREAM.Create_Session() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> windream initialized", False) + LOGGER.Debug(" >> windream initialized", False) Return True Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error Init_windream:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") - ClassLogger.Add(">> Unexpected error in Init_windream: " & ex.Message, True) + LOGGER.Info(">> Unexpected error in Init_windream: " & ex.Message, True) Return False End Try End Function @@ -1027,6 +1061,7 @@ Public Class frmMain End If End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unhandled Error in tsmiMarkedFilesFinish_Click: " & ex.Message) End Try End Sub @@ -1053,7 +1088,7 @@ Public Class frmMain tslblmessage.Text = "" If CURRENT_DT_VW_PROFILE_USER.Rows.Count = 0 Then - ClassLogger.Add(" >> no profiles for user: '" & Environment.UserName & "' configured!", False) + LOGGER.Info(" >> no profiles for user: '" & Environment.UserName & "' configured!", False) NO_WORKFLOWITEMS = True tslblmessage.Text = "Keine Profile für Ihren User hinterlegt" Cursor = Cursors.Default @@ -1083,7 +1118,8 @@ Public Class frmMain Try DTGRID_GROUPS = ClassDatabase.Return_Datatable($"SELECT * FROM TBPM_MAIN_VIEW_GROUPS WHERE ACTIVE = 1", True) Catch ex As Exception - ClassLogger.Add(ex.Message) + LOGGER.Error(ex) + LOGGER.Info(ex.Message) End Try @@ -1101,6 +1137,7 @@ Public Class frmMain Try GridView_Docs.Columns.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try Cursor = Cursors.Default @@ -1150,7 +1187,7 @@ Public Class frmMain Dim oindex As Integer = 0 If Not IsNothing(DTGRID_GROUPS) Then For Each oGridGroup As DataRow In DTGRID_GROUPS.Rows - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Addig group [{oGridGroup.Item("GROUPNAME")}] for Grid...", False) + LOGGER.Debug($" >> Addig group [{oGridGroup.Item("GROUPNAME")}] for Grid...", False) GridView_Docs.Columns.Item(oGridGroup.Item("GROUPNAME")).GroupIndex = oindex oindex += 1 Next @@ -1158,13 +1195,13 @@ Public Class frmMain GridView_Docs.Columns.Item("PROFILE_GROUP_TEXT").GroupIndex = oindex End If - + GridView_Docs.Columns.Item("PROFILE_GROUP_TEXT").Visible = False GridView_Docs.Columns.Item("PROFILE_GROUP_COLOR").Visible = False For index = 0 To GridView_Docs.GroupCount - 1 Dim v = GridView_Docs.GroupedColumns(index).ToString - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Addig tag [{GridView_Docs.Columns.Item("PROFILE_ID")}] for group...", False) + LOGGER.Debug($" >> Addig tag [{GridView_Docs.Columns.Item("PROFILE_ID")}] for group...", False) GridView_Docs.GroupedColumns(index).Tag = GridView_Docs.Columns.Item("PROFILE_ID") Next @@ -1180,7 +1217,8 @@ Public Class frmMain GridView_Docs.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime GridView_Docs.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" Catch ex As Exception - ClassLogger.Add("Unexpected Error in Formatting Grid: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Formatting Grid: " & ex.Message) End Try Try For Each grid_column As GridColumn In GridView_Docs.Columns @@ -1202,6 +1240,7 @@ Public Class frmMain Try grid_column.Dispose() Catch ex As Exception + LOGGER.Error(ex) End Try @@ -1211,7 +1250,8 @@ Public Class frmMain End If Next Catch ex As Exception - ClassLogger.Add("Unexpected Error in Checking ColumnsGrid: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Checking ColumnsGrid: " & ex.Message) End Try @@ -1219,7 +1259,7 @@ Public Class frmMain 'GridView_Docs.SaveLayoutToXml(GetXML_LayoutName()) SaveGridLayout() If GridView_Docs.Columns.Count <= 2 Then - ClassLogger.Add("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False) + LOGGER.Info("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False) Reset_GridLayout() End If @@ -1231,6 +1271,7 @@ Public Class frmMain Try GridView_Docs.Columns.Clear() Catch ex As Exception + LOGGER.Error(ex) End Try End If @@ -1240,7 +1281,8 @@ Public Class frmMain Catch ex As Exception - ClassLogger.Add("Load_Grid_Overview - Fehler: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Load_Grid_Overview - Fehler: " & ex.Message) MsgBox("Fehler Load_Grid_Overview - Fehler: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try Cursor = Cursors.Default @@ -1308,6 +1350,7 @@ Public Class frmMain End If Catch ex As Exception + LOGGER.Error(ex) End Try End Sub @@ -1347,6 +1390,7 @@ Public Class frmMain End If Catch ex As Exception + LOGGER.Error(ex) End Try End Sub diff --git a/app/DD_PM_WINDREAM/frmMassValidator.vb b/app/DD_PM_WINDREAM/frmMassValidator.vb index d2f2b3e..9dbeb42 100644 --- a/app/DD_PM_WINDREAM/frmMassValidator.vb +++ b/app/DD_PM_WINDREAM/frmMassValidator.vb @@ -35,11 +35,12 @@ Public Class frmMassValidator '_windreamPM.Create_Session() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add("windream initialized frmMassValidator", False) + LOGGER.Debug("windream initialized frmMassValidator", False) Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error Init_windream:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") - ClassLogger.Add(">> Fehler in Init_windream: " & ex.Message, True) + LOGGER.Info(">> Fehler in Init_windream: " & ex.Message, True) Exit Sub End Try @@ -53,10 +54,11 @@ Public Class frmMassValidator End If Try DT_PROFILE_CONTROLS = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_PROFILE_CONTROLS WHERE CTRL_TYPE <> 'TABLE' AND SQL_UEBERPRUEFUNG NOT LIKE '%WMI%' AND PROFIL_ID = " & CURRENT_ProfilGUID) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Profile Data geladen", False) + LOGGER.Debug(" >> Profile Data geladen", False) Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error LOADING profile-data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") - ClassLogger.Add(">> Fehler in LOADING profile-data: " & ex.Message, True) + LOGGER.Info(">> Fehler in LOADING profile-data: " & ex.Message, True) Me.Close() End Try @@ -64,7 +66,7 @@ Public Class frmMassValidator Delimiter = CURRENT_DT_CONFIG.Rows(0).Item("VEKTOR_DELIMITER") If CURRENT_DT_PROFILE.Rows.Count = 0 Then - ClassLogger.Add(">> Profildaten konnten nicht geladen werden - Übergebenes Profil: : " & CURRENT_ProfilName, True) + LOGGER.Info(">> Profildaten konnten nicht geladen werden - Übergebenes Profil: : " & CURRENT_ProfilName, True) MsgBox("Achtung: Profildaten konnten nicht übergeben oder geladen werden.", MsgBoxStyle.Critical, "Achtung:") Me.Close() End If @@ -95,10 +97,10 @@ Public Class frmMassValidator Next If LOG_ERRORS_ONLY = False Then - ClassLogger.Add(" >> Profildaten gespeichert", False) - ClassLogger.Add(" >> WD_Search: " & WM_SEARCH, False) - ClassLogger.Add(" >> finalProfile: " & FINAL_PROFILE, False) - ClassLogger.Add(" >> Move2Folder: " & MOVE2Folder, False) + LOGGER.Info(" >> Profildaten gespeichert", False) + LOGGER.Info(" >> WD_Search: " & WM_SEARCH, False) + LOGGER.Info(" >> finalProfile: " & FINAL_PROFILE, False) + LOGGER.Info(" >> Move2Folder: " & MOVE2Folder, False) End If @@ -110,7 +112,7 @@ Public Class frmMassValidator 'Catch ex As Exception ' MsgBox("Error SAVING Profile-Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") - ' ClassLogger.Add(">> Fehler in SAVING Profile-Data: " & ex.Message, True) + ' LOGGER.Info(">> Fehler in SAVING Profile-Data: " & ex.Message, True) 'End Try 'Me.lblerror.Visible = False @@ -118,100 +120,100 @@ Public Class frmMassValidator btnSave.Text = String.Format("Finish all documents (#{0})", CURRENT_DT_MASS_CHANGE_DOCS.Rows.Count.ToString) Else btnSave.Text = String.Format("Alle Dokumente (#{0}) abschliessen.", CURRENT_DT_MASS_CHANGE_DOCS.Rows.Count.ToString) - End If + End If End Sub Sub Load_Controls() ' Try pnldesigner.Controls.Clear() - 'Dim dt As DataTable = DD_DMSLiteDataSet.VWPM_CONTROL_INDEX + 'Dim dt As DataTable = DD_DMSLiteDataSet.VWPM_CONTROL_INDEX - For Each dr As DataRow In DT_PROFILE_CONTROLS.Rows - Dim ctrl As Control + For Each dr As DataRow In DT_PROFILE_CONTROLS.Rows + Dim ctrl As Control - Select Case dr.Item("CTRL_TYPE").ToString.ToUpper - Case "TXT" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch TXT zu laden", False) - Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(dr, False) + Select Case dr.Item("CTRL_TYPE").ToString.ToUpper + Case "TXT" + LOGGER.Debug(" >> Versuch TXT zu laden", False) + Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(dr, False) - AddHandler txt.GotFocus, AddressOf OnTextBoxFocus - AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus - AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp + AddHandler txt.GotFocus, AddressOf OnTextBoxFocus + AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus + AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp - ctrl = txt - Case "LBL" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch LBL zu laden", False) - ctrl = ClassControlCreator.CreateExistingLabel(dr, False) - Case "CMB" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch CMB zu laden", False) + ctrl = txt + Case "LBL" + LOGGER.Debug(" >> Versuch LBL zu laden", False) + ctrl = ClassControlCreator.CreateExistingLabel(dr, False) + Case "CMB" + LOGGER.Debug(" >> Versuch CMB zu laden", False) - Dim cmb = ClassControlCreator.CreateExistingCombobox(dr, False) + Dim cmb = ClassControlCreator.CreateExistingCombobox(dr, False) - AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex + AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex #Region "CONTROL LIST" - If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then - MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) - Exit Sub - End If - Dim CURR_SQL_PROVIDER As String - If CURRENT_CONTROL_ID > 0 Then - If CURR_CON_ID > 0 Then - Dim commandsql = CURR_SELECT_CONTROL - If commandsql <> "" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> ConID > 0 And commandsql <> ''", False) - Dim connectionString As String + If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then + MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) + Exit Sub + End If + Dim CURR_SQL_PROVIDER As String + If CURRENT_CONTROL_ID > 0 Then + If CURR_CON_ID > 0 Then + Dim commandsql = CURR_SELECT_CONTROL + If commandsql <> "" Then + LOGGER.Debug(" >> ConID > 0 And commandsql <> ''", False) + Dim connectionString As String - Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID) - If ConRow Is Nothing Then - MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) - Exit Sub - End If + Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID) + If ConRow Is Nothing Then + MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) + Exit Sub + End If - For Each row As DataRow In ConRow - Select Case row("SQL_PROVIDER").ToString.ToLower - Case "ms-sql" - CURR_SQL_PROVIDER = "ms-sql" - If row("USERNAME") = "WINAUTH" Then - connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;" - Else - connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";" - End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> ConnString Sql-Server: " & connectionString) - Case "oracle" - CURR_SQL_PROVIDER = "oracle" - Dim conn As New OracleConnectionStringBuilder - Dim connstr As String - If row("SERVER") <> "" And row("DATENBANK").GetType.ToString <> "system.dbnull" Then - connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & row("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & + For Each row As DataRow In ConRow + Select Case row("SQL_PROVIDER").ToString.ToLower + Case "ms-sql" + CURR_SQL_PROVIDER = "ms-sql" + If row("USERNAME") = "WINAUTH" Then + connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;" + Else + connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";" + End If + LOGGER.Debug(" >> ConnString Sql-Server: " & connectionString) + Case "oracle" + CURR_SQL_PROVIDER = "oracle" + Dim conn As New OracleConnectionStringBuilder + Dim connstr As String + If row("SERVER") <> "" And row("DATENBANK").GetType.ToString <> "system.dbnull" Then + connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & row("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & row("DATENBANK") & ")));User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";" - Else - conn.DataSource = row("SERVER") - conn.UserID = row("USERNAME") - conn.Password = row("PASSWORD") - conn.PersistSecurityInfo = True - conn.ConnectionTimeout = 120 - connstr = conn.ConnectionString - End If + Else + conn.DataSource = row("SERVER") + conn.UserID = row("USERNAME") + conn.Password = row("PASSWORD") + conn.PersistSecurityInfo = True + conn.ConnectionTimeout = 120 + connstr = conn.ConnectionString + End If - connectionString = connstr - Case Else - ClassLogger.Add("ConnectionString-Type not integrated", False) - MsgBox("ConnectionString-Type not integrated", MsgBoxStyle.Critical) - Exit Sub - End Select + connectionString = connstr + Case Else + LOGGER.Info("ConnectionString-Type not integrated", False) + MsgBox("ConnectionString-Type not integrated", MsgBoxStyle.Critical) + Exit Sub + End Select - Next + Next - If connectionString Is Nothing = False And CURR_SQL_PROVIDER = "ms-sql" Then - Try - Dim sqlCnn As SqlClient.SqlConnection - Dim sqlCmd As SqlClient.SqlCommand - Dim adapter As New SqlClient.SqlDataAdapter - Dim NewDataset As New DataSet - Dim i As Integer + If connectionString Is Nothing = False And CURR_SQL_PROVIDER = "ms-sql" Then + Try + Dim sqlCnn As SqlClient.SqlConnection + Dim sqlCmd As SqlClient.SqlCommand + Dim adapter As New SqlClient.SqlDataAdapter + Dim NewDataset As New DataSet + Dim i As Integer 'sql = ClassPatterns.ReplaceAllValues(sql, pnldesigner, aktivesDokument) @@ -234,61 +236,62 @@ Public Class frmMassValidator sqlCnn.Close() End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in running depending sql-command: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in running depending sql-command: " & ex.Message) Clipboard.SetText("Error: " & ex.Message & vbNewLine & "SQL: " & CURR_SELECT_CONTROL) MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected Error in running depending sql-command:") End Try - End If - Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Else Row 571", False) End If Else - If CURR_CHOICE_LIST <> "" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> In add_ComboBox - AListe: " & CURR_CHOICE_LIST, False) + LOGGER.Debug(" >> Else Row 571", False) + End If + Else + If CURR_CHOICE_LIST <> "" Then + LOGGER.Debug(" >> In add_ComboBox - AListe: " & CURR_CHOICE_LIST, False) Dim liste = WINDREAM.GetValuesfromAuswahlliste(CURR_CHOICE_LIST) If liste IsNot Nothing Then - cmb.Items.Add("") - For Each index As String In liste - cmb.Items.Add(index) - Next - cmb.SelectedIndex = -1 - Else - MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST) - End If + cmb.Items.Add("") + For Each index As String In liste + cmb.Items.Add(index) + Next + cmb.SelectedIndex = -1 + Else + MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST) End If End If End If + End If #End Region - Dim maxWith As Integer = cmb.Width - Using g As Graphics = Me.CreateGraphics - For Each oItem As Object In cmb.Items 'Für alle Einträge... - Dim g1 As Graphics = cmb.CreateGraphics - If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then - maxWith = g1.MeasureString(Text, cmb.Font).Width + 30 - End If - g1.Dispose() - Next oItem - End Using - cmb.DropDownWidth = maxWith + Dim maxWith As Integer = cmb.Width + Using g As Graphics = Me.CreateGraphics + For Each oItem As Object In cmb.Items 'Für alle Einträge... + Dim g1 As Graphics = cmb.CreateGraphics + If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then + maxWith = g1.MeasureString(Text, cmb.Font).Width + 30 + End If + g1.Dispose() + Next oItem + End Using + cmb.DropDownWidth = maxWith - ctrl = cmb - Case "DTP" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch DTP zu laden", False) - ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False) - Case "DGV" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch DGV zu laden", False) - Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False) + ctrl = cmb + Case "DTP" + LOGGER.Debug(" >> Versuch DTP zu laden", False) + ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False) + Case "DGV" + LOGGER.Debug(" >> Versuch DGV zu laden", False) + Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False) - AddHandler dgv.RowValidating, AddressOf onDGVRowValidating + AddHandler dgv.RowValidating, AddressOf onDGVRowValidating - ctrl = dgv - Case "CHK" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Checkbox zu laden", False) + ctrl = dgv + Case "CHK" + LOGGER.Debug(" >> Versuch Checkbox zu laden", False) - ctrl = ClassControlCreator.CreateExisingCheckbox(dr, False) + ctrl = ClassControlCreator.CreateExisingCheckbox(dr, False) 'Case "TABLE" - ' If LogErrorsOnly = False Then ClassLogger.Add(" >> Versuch Tabelle zu laden", False) + ' If LogErrorsOnly = False Then LOGGER.Info(" >> Versuch Tabelle zu laden", False) ' For Each c As DataColumn In DT_PROFILE_CONTROLS.Columns ' '... = c.ColumnName @@ -300,32 +303,32 @@ Public Class frmMassValidator ' ctrl = ClassControlCreator.CreateExistingTable(dr, columns, False) - Case "LINE" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Linie zu laden", False) + Case "LINE" + LOGGER.Debug(" >> Versuch Linie zu laden", False) - ctrl = ClassControlCreator.CreateExistingLine(dr, False) - End Select + ctrl = ClassControlCreator.CreateExistingLine(dr, False) + End Select - If TypeOf ctrl IsNot Label Then - ' If first_control Is Nothing Then - 'first_control = ctrl - 'End If - 'last_control = ctrl - End If + If TypeOf ctrl IsNot Label Then + ' If first_control Is Nothing Then + 'first_control = ctrl + 'End If + 'last_control = ctrl + End If - pnldesigner.Controls.Add(ctrl) + pnldesigner.Controls.Add(ctrl) - LoadSimpleData(ctrl, dr.Item("GUID")) - Next - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Controls geladen", False) - ClassLogger.Add("", False) - CTRLS_Loaded = True - FillIndexValues() + LoadSimpleData(ctrl, dr.Item("GUID")) + Next + LOGGER.Debug(" >> Controls geladen", False) + LOGGER.Info("", False) + CTRLS_Loaded = True + FillIndexValues() 'Catch ex As Exception ' If LogErrorsOnly = False Then MsgBox("Error Load_Controls: " & ex.Message, MsgBoxStyle.Critical, "Attention error:") ' ' allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Load_Controls: " & ex.Message, Environment.UserName) - ' ClassLogger.Add("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message) - ' ClassLogger.Add("", False) + ' LOGGER.Info("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message) + ' LOGGER.Info("", False) 'End Try @@ -354,7 +357,7 @@ Public Class frmMassValidator Dim defaultValue As String = NotNull(controlRow.Item("DEFAULT_VALUE"), String.Empty) indexname = idxname Dim LoadIDX As Boolean = controlRow.Item("LOAD_IDX_VALUE") - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> INDEX: " & idxname & " - CONTROLNAME: " & inctrl.Name & " - LOAD IDXVALUES: " & LoadIDX.ToString, False) + LOGGER.Debug(" >> INDEX: " & idxname & " - CONTROLNAME: " & inctrl.Name & " - LOAD IDXVALUES: " & LoadIDX.ToString, False) Dim wertWD Select Case Type Case "System.Windows.Forms.TextBox" @@ -368,7 +371,7 @@ Public Class frmMassValidator If LoadIDX = False Or idxname = "DD PM-ONLY FOR DISPLAY" Then ' Wenn kein Index exisitiert, defaultValue laden inctrl.Text = defaultValue - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If @@ -381,12 +384,13 @@ Public Class frmMassValidator End If Catch ex As Exception + LOGGER.Error(ex) errormessage = "Unexpected error in FillIndexValues TextBox(MI):" & vbNewLine & ex.Message & vbNewLine & "Check Logfile" My.Settings.Save() frmError.ShowDialog() - ClassLogger.Add(">> Unexpected error in FillIndexValues TextBox(MI): " & ex.Message, True) - ClassLogger.Add(">> Controltype: " & controltype, False) - ClassLogger.Add(">> Indexname windream: " & indexname, False) + LOGGER.Info(">> Unexpected error in FillIndexValues TextBox(MI): " & ex.Message, True) + LOGGER.Info(">> Controltype: " & controltype, False) + LOGGER.Info(">> Indexname windream: " & indexname, False) Exit Sub End Try @@ -404,7 +408,7 @@ Public Class frmMassValidator Else cmb.Text = defaultValue End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If wertWD = GetWM_Value_Multiple_Docs(idxname) @@ -428,7 +432,7 @@ Public Class frmMassValidator End If If idxname Is Nothing = False Then If LoadIDX = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If @@ -501,7 +505,7 @@ Public Class frmMassValidator Dim chk As CheckBox = inctrl If LoadIDX = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) If defaultValue <> String.Empty Then Dim result @@ -515,7 +519,7 @@ Public Class frmMassValidator wertWD = GetWM_Value_Multiple_Docs(idxname) If wertWD Is Nothing Then - ClassLogger.Add(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & indexname & "' ist nothing. Check defaultvalue", False) + LOGGER.Info(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & indexname & "' ist nothing. Check defaultvalue", False) chk.Checked = False Else If wertWD.ToString = "" Then @@ -531,11 +535,11 @@ Public Class frmMassValidator Else Dim _value If wertWD.ToString = "System.Object[]" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> CheckBoxValue with VektorField: " & idxname, False) + LOGGER.Debug(" >> CheckBoxValue with VektorField: " & idxname, False) If wertWD.length = 1 Then _value = wertWD(0) Else ' - ClassLogger.Add(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False) _value = wertWD(0) End If Else @@ -549,7 +553,8 @@ Public Class frmMassValidator chk.Checked = False End Select Catch ex As Exception - ClassLogger.Add(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True) + LOGGER.Error(ex) + LOGGER.Info(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True) chk.Checked = False End Try End If @@ -566,12 +571,13 @@ Public Class frmMassValidator End Select Next Catch ex As Exception + LOGGER.Error(ex) errormessage = "Unexpected Error in FillIndexValues(MI):" & vbNewLine & ex.Message & vbNewLine & "Check Logfile" My.Settings.Save() frmError.ShowDialog() - ClassLogger.Add(">> Unexpected Error in FillIndexValues(MIs: " & ex.Message, True) - ClassLogger.Add(">> Controltype: " & controltype, False) - ClassLogger.Add(">> Indexname windream: " & indexname, False) + LOGGER.Info(">> Unexpected Error in FillIndexValues(MIs: " & ex.Message, True) + LOGGER.Info(">> Controltype: " & controltype, False) + LOGGER.Info(">> Indexname windream: " & indexname, False) End Try @@ -588,7 +594,8 @@ Public Class frmMassValidator Try WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH")) Catch ex As Exception - ClassLogger.Add("error while creating WMObject in (textCheckIndex): " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("error while creating WMObject in (textCheckIndex): " & ex.Message) Exit For End Try If Not IsNothing(WMDOC) Then @@ -599,11 +606,11 @@ Public Class frmMassValidator tempIndexValue = WMDOC.GetVariableValue(idxname) If IsNothing(tempIndexValue) Then tempIndexValue = "" If tempIndexValue.ToString = "System.Object[]" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> TextBox with VektorField: " & idxname, False) + LOGGER.Debug(" >> TextBox with VektorField: " & idxname, False) If tempIndexValue.Length = 1 Then tempIndexValue = tempIndexValue(0) Else ' - ClassLogger.Add(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False) tempIndexValue = tempIndexValue(0) End If End If @@ -625,7 +632,8 @@ Public Class frmMassValidator Next Return valueAllOver Catch ex As Exception - ClassLogger.Add("Unexpected error in GetWM_Value_Multiple_Docs: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected error in GetWM_Value_Multiple_Docs: " & ex.Message, True) Return "Unexp. error in GetWM_Value_Multiple_Docs" End Try End Function @@ -665,8 +673,9 @@ Public Class frmMassValidator If value Is Nothing Then value = "" Return value Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unexpected Error in ReturnVektor_IndexValue(MV): " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - ClassLogger.Add("Unexpected Error in ReturnVektor_IndexValue(MV): " & ex.Message) + LOGGER.Info("Unexpected Error in ReturnVektor_IndexValue(MV): " & ex.Message) Return "" End Try @@ -703,22 +712,23 @@ Public Class frmMassValidator For Each ROW As DataRow In CURR_DT_DEPENDING_CONTROLS.Rows 'Try Dim displayboxname = ROW.Item(Name).ToString - If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then - Dim sql_Statement = ROW.Item(2) + If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then + Dim sql_Statement = ROW.Item(2) sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, WMObject, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) _dependingControl_in_action = True - Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1)) - _dependingControl_in_action = False - End If + Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1)) + _dependingControl_in_action = False + End If 'Catch ex As Exception - ' ClassLogger.Add("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) 'End Try Next Catch ex As Exception - ClassLogger.Add("Unexpected Error in Eventhandler OnTextBoxKeyUp - ERROR: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Eventhandler OnTextBoxKeyUp - ERROR: " & ex.Message) End Try End If @@ -728,9 +738,9 @@ Public Class frmMassValidator Private Sub Depending_Control_Set_Result(displayboxname As String, sqlCommand As String, sqlConnection As String) 'Try Dim resultDT As DataTable = ClassDatabase.Return_Datatable_CS(sqlCommand, sqlConnection) - If Not IsNothing(resultDT) Then - 'Ist das Control ein Control was mehrfachwerte enthalten kann - If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_DATAGRIDVIEW) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then + If Not IsNothing(resultDT) Then + 'Ist das Control ein Control was mehrfachwerte enthalten kann + If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_DATAGRIDVIEW) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Then Dim cmbpanel As ComboBox = pnldesigner.Controls(displayboxname) If IsNothing(cmbpanel) Then @@ -743,17 +753,17 @@ Public Class frmMassValidator ElseIf displayboxname.StartsWith(ClassControlCreator.PREFIX_DATAGRIDVIEW) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then 'not implemented End If - Else + Else If resultDT.Rows.Count = 1 Then pnldesigner.Controls(displayboxname).Text = resultDT.Rows(0).Item(0).ToString Else pnldesigner.Controls(displayboxname).Text = "RESULT = resultDT.Rows.Count <> 1" - ClassLogger.Add(">> Datatable-SQL: " & sqlCommand, False) + LOGGER.Info(">> Datatable-SQL: " & sqlCommand, False) End If End If - End If + End If 'Catch ex As Exception - ' ClassLogger.Add("Unexpected Ersror in Depending_Control_Set_Result - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Ersror in Depending_Control_Set_Result - ERROR: " & ex.Message) ' MsgBox("Unexpected error in Depending_Control_Set_Result: " & ex.Message, MsgBoxStyle.Critical) 'End Try End Sub @@ -762,14 +772,14 @@ Public Class frmMassValidator If cmb.SelectedIndex <> -1 And CTRLS_Loaded = True And FORM_Shown = True Then ' Try If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then - MsgBox("Unexpected Error in getting control-properties CMB - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) - Exit Sub - End If + MsgBox("Unexpected Error in getting control-properties CMB - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) + Exit Sub + End If - If ClassControlCreator.GET_DEPENDING_CONTROLS(DT_PROFILE_CONTROLS, cmb.Name) = False Then - MsgBox("Unexpected Error in getting dependent controls CMB- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) - Exit Sub - End If + If ClassControlCreator.GET_DEPENDING_CONTROLS(DT_PROFILE_CONTROLS, cmb.Name) = False Then + MsgBox("Unexpected Error in getting dependent controls CMB- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) + Exit Sub + End If If _dependingControl_in_action = True Or CURR_DT_DEPENDING_CONTROLS Is Nothing Then Exit Sub End If @@ -777,24 +787,24 @@ Public Class frmMassValidator For Each ROW As DataRow In CURR_DT_DEPENDING_CONTROLS.Rows 'Try Dim displayboxname = ROW.Item("NAME").ToString - If Not IsDBNull(ROW.Item("CONNECTION_ID")) And Not IsDBNull(ROW.Item("SQL_UEBERPRUEFUNG")) Then - Dim sql_Statement = ROW.Item("SQL_UEBERPRUEFUNG") + If Not IsDBNull(ROW.Item("CONNECTION_ID")) And Not IsDBNull(ROW.Item("SQL_UEBERPRUEFUNG")) Then + Dim sql_Statement = ROW.Item("SQL_UEBERPRUEFUNG") sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, WMObject, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) _dependingControl_in_action = True - Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1)) - _dependingControl_in_action = False + Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1)) + _dependingControl_in_action = False - End If + End If 'Catch ex As Exception - ' ClassLogger.Add("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) 'End Try Next 'Catch ex As Exception - ' ClassLogger.Add("Unexpected Error in Eventhandler OnCmbselectedIndex - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Error in Eventhandler OnCmbselectedIndex - ERROR: " & ex.Message) 'End Try SendKeys.Send("{TAB}") @@ -846,7 +856,8 @@ Public Class frmMassValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) End Try Next @@ -854,7 +865,8 @@ Public Class frmMassValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message) End Try End Sub @@ -924,7 +936,8 @@ Public Class frmMassValidator Try WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH")) Catch ex As Exception - ClassLogger.Add("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message) Exit For End Try If Not IsNothing(WMDOC) Then @@ -943,6 +956,7 @@ Public Class frmMassValidator WORK_HISTORY_ENTRY = Nothing End If Catch ex As Exception + LOGGER.Error(ex) WORK_HISTORY_ENTRY = Nothing End Try If Not IsNothing(WORK_HISTORY_ENTRY) Then @@ -956,7 +970,7 @@ Public Class frmMassValidator ' alle Vorkommen innerhalbd er Namenkonvention durchlaufen For Each element As System.Text.RegularExpressions.Match In elemente Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False) + LOGGER.Debug(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False) Dim CTRL_ID = element.Value.Substring(2, element.Value.Length - 3) CTRL_ID = CTRL_ID.Replace("CTRLID", "") Dim value_from_control @@ -972,6 +986,7 @@ Public Class frmMassValidator Try value_from_control = inctrl.Text Catch ex As Exception + LOGGER.Error(ex) value_from_control = String.Empty End Try @@ -980,6 +995,7 @@ Public Class frmMassValidator Try value_from_control = cmb.Text Catch ex As Exception + LOGGER.Error(ex) value_from_control = String.Empty End Try Case "System.Windows.Forms.DateTimePicker" @@ -987,6 +1003,7 @@ Public Class frmMassValidator Try value_from_control = dtp.Value.ToString Catch ex As Exception + LOGGER.Error(ex) value_from_control = String.Empty End Try @@ -995,6 +1012,7 @@ Public Class frmMassValidator Try value_from_control = chk.Checked Catch ex As Exception + LOGGER.Error(ex) value_from_control = String.Empty End Try End Select @@ -1005,7 +1023,8 @@ Public Class frmMassValidator WORK_HISTORY_ENTRY = WORK_HISTORY_ENTRY.ToString.Replace(element.Value, value_from_control) End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message) End Try Next If WORK_HISTORY_ENTRY.ToString.Contains("@DATE") Then @@ -1086,7 +1105,7 @@ Public Class frmMassValidator ' errormessage = "Unvorhergesehener Fehler bei Abschluss:" & ex.Message ' My.Settings.Save() ' frmError.ShowDialog() - ' ClassLogger.Add(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True) + ' LOGGER.Info(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True) 'End Try Else 'lblerror.Visible = True @@ -1119,9 +1138,9 @@ Public Class frmMassValidator Dim ctrl = dr.Item("NAME") 'Nur wenn der Name der Zeile entspricht und der Index READ_ONLY FALSE ist If dr.Item("NAME") = inctrl.Name And (_READ_ONLY = False Or dr.Item("SQL_UEBERPRUEFUNG") <> "") And _IDXName <> "DD PM-ONLY FOR DISPLAY" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexierung für Control (" & CONTROL_ID & ") '" & ctrl & "' gestartet. Indexname '" & _IDXName & "'", False) + LOGGER.Debug(" >> Indexierung für Control (" & CONTROL_ID & ") '" & ctrl & "' gestartet. Indexname '" & _IDXName & "'", False) If _IDXName = "" Then - ClassLogger.Add(" >> Indexname is unexpected empty.", False) + LOGGER.Info(" >> Indexname is unexpected empty.", False) Continue For End If Dim Type As String = inctrl.GetType.ToString @@ -1166,10 +1185,11 @@ Public Class frmMassValidator End If Catch ex As Exception + LOGGER.Error(ex) Dim st As New StackTrace(True) st = New StackTrace(ex, True) MsgBox("Unvorhergesehener Fehler in Check_UpdateIndexe TextBox: " & vbNewLine & ex.Message & vbNewLine & "Line: " & st.GetFrame(0).GetFileLineNumber().ToString, MsgBoxStyle.Critical, "Error:") - ClassLogger.Add("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) + LOGGER.Info("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) Return True End Try @@ -1247,7 +1267,7 @@ Public Class frmMassValidator End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DateValue is 01.01.0001 00:00:00", False) + LOGGER.Debug(" >> DateValue is 01.01.0001 00:00:00", False) End If Case "System.Windows.Forms.CheckBox" Dim chk As CheckBox = inctrl @@ -1364,7 +1384,7 @@ Public Class frmMassValidator ' Dim st As New StackTrace(True) ' st = New StackTrace(ex, True) ' MsgBox("Unvorhergesehener Fehler in Check_UpdateIndexe: " & vbNewLine & ex.Message & vbNewLine & "Line: " & st.GetFrame(0).GetFileLineNumber().ToString, MsgBoxStyle.Critical, "Error:") - ' ClassLogger.Add("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) + ' LOGGER.Info("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) ' Return True 'End Try @@ -1387,7 +1407,8 @@ Public Class frmMassValidator Try WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH")) Catch ex As Exception - ClassLogger.Add("error while creating WMObject in (IndexMultipleFiles): " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("error while creating WMObject in (IndexMultipleFiles): " & ex.Message) _allfine = False Exit For @@ -1404,7 +1425,7 @@ Public Class frmMassValidator 'Das Array der Idnexwerte überprüfen If idxvalue Is Nothing = False Then If idxvalue.Length() > 1 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) Dim anzahl As Integer = 0 For Each indexvalue As String In idxvalue ReDim Preserve arrValue(anzahl) @@ -1412,7 +1433,7 @@ Public Class frmMassValidator anzahl += 1 Next Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) ReDim Preserve arrValue(0) arrValue(0) = idxvalue(0).ToString End If @@ -1427,7 +1448,8 @@ Public Class frmMassValidator Return _allfine Catch ex As Exception - ClassLogger.Add("Unexpected error in IndexMultipleFiles: " & ex.Message.ToString, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected error in IndexMultipleFiles: " & ex.Message.ToString, True) Return False End Try End Function @@ -1439,7 +1461,8 @@ Public Class frmMassValidator Try WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH")) Catch ex As Exception - ClassLogger.Add("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message) _allfine = False missing = True Exit For @@ -1498,7 +1521,7 @@ Public Class frmMassValidator 'Das Array der Idnexwerte überprüfen If idxvalue Is Nothing = False Then If idxvalue.Length() > 1 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) Dim anzahl As Integer = 0 For Each indexvalue As String In idxvalue ReDim Preserve arrValue(anzahl) @@ -1506,7 +1529,7 @@ Public Class frmMassValidator anzahl += 1 Next Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) ReDim Preserve arrValue(0) arrValue(0) = idxvalue(0).ToString End If @@ -1516,7 +1539,8 @@ Public Class frmMassValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in IndexSinglefile: " & ex.Message.ToString, True) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in IndexSinglefile: " & ex.Message.ToString, True) Return Err() End Try End Function @@ -1526,7 +1550,8 @@ Public Class frmMassValidator Dim Bezeichner As String = VKTBezeichner.Replace("[%VKT", "") PM_String = "DD-PM" & Delimiter & Bezeichner & Delimiter & input & Delimiter & Environment.UserName & Delimiter & Now.ToString Catch ex As Exception - ClassLogger.Add(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True) PM_String = "DD-PM ERROR: " & ex.Message End Try Return PM_String @@ -1542,7 +1567,8 @@ Public Class frmMassValidator End If Catch ex As Exception - ClassLogger.Add(">> Fehler in Return_LOGString: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info(">> Fehler in Return_LOGString: " & ex.Message, True) PM_String = "DD-PM ERROR: " & ex.Message End Try Return PM_String diff --git a/app/DD_PM_WINDREAM/frmSQL_Admin.vb b/app/DD_PM_WINDREAM/frmSQL_Admin.vb index b0cb622..ac28ff8 100644 --- a/app/DD_PM_WINDREAM/frmSQL_Admin.vb +++ b/app/DD_PM_WINDREAM/frmSQL_Admin.vb @@ -26,6 +26,7 @@ Public Class frmSQL_Admin MsgBox("Der SQL-Befehl wurde erfolgreich ausgeführt!", MsgBoxStyle.Information, "Erfolgsmeldung:") connection.Close() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Datenbank-Connect:") End Try Cursor = Cursors.Default @@ -49,7 +50,7 @@ Public Class frmSQL_Admin Try With OpenFileDialog1 ' Do - + .Title = "Wählen Sie bitte die SQL-File:" If .ShowDialog() = DialogResult.OK Then Dim FILE_NAME As String = .FileName @@ -58,8 +59,9 @@ Public Class frmSQL_Admin objReader.Close() End If End With - + Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei open-File:") End Try diff --git a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb index 803b1ce..cc0fc77 100644 --- a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb +++ b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb @@ -58,6 +58,7 @@ Public Class frmSQL_DESIGNER 'Windream initialisieren (Connection, Session, ... aufbauen) '_windreamPM.Create_Session() Catch ex As Exception + LOGGER.Error(ex) MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try cmbIndexe.Items.Clear() @@ -82,6 +83,7 @@ Public Class frmSQL_DESIGNER btnAddControl.Visible = False End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Unexpected Error while loading form: " & ex.Message, MsgBoxStyle.Critical) End Try @@ -183,7 +185,7 @@ Public Class frmSQL_DESIGNER Return dataset Else - If LOG_ERRORS_ONLY = True Then ClassLogger.Add(" >> It's an Oracle-Connection (ExecuteWithConnection)", False) + If LOG_ERRORS_ONLY = True Then LOGGER.Info(" >> It's an Oracle-Connection (ExecuteWithConnection)", False) Dim sqlConnection As OracleConnection Dim sqlCommand As OracleCommand Dim sqlAdapter As New OracleDataAdapter @@ -204,7 +206,8 @@ Public Class frmSQL_DESIGNER End If Catch ex As Exception - ClassLogger.Add(" - Unvorhergesehener Fehler bei TestSQL - Fehler: " & vbNewLine & ex.Message) + LOGGER.Error(ex) + LOGGER.Info(" - Unvorhergesehener Fehler bei TestSQL - Fehler: " & vbNewLine & ex.Message) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei TestSQL:") Return Nothing End Try diff --git a/app/DD_PM_WINDREAM/frmSplash.vb b/app/DD_PM_WINDREAM/frmSplash.vb index d892260..bb42886 100644 --- a/app/DD_PM_WINDREAM/frmSplash.vb +++ b/app/DD_PM_WINDREAM/frmSplash.vb @@ -112,7 +112,7 @@ Public NotInheritable Class frmSplash Private Sub bw_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) ' Bei Fehler MsgBox anzeigen und Programm beenden If e.Error IsNot Nothing Then - ClassLogger.Add("Unexpected error in Initializing application....") + LOGGER.Info("Unexpected error in Initializing application....") MsgBox(e.Error.Message, MsgBoxStyle.Critical, "Unexpected error in Initializing application") Application.Exit() End If diff --git a/app/DD_PM_WINDREAM/frmUserKonfig_AddUsers.vb b/app/DD_PM_WINDREAM/frmUserKonfig_AddUsers.vb index 63ec6b8..0fbadad 100644 --- a/app/DD_PM_WINDREAM/frmUserKonfig_AddUsers.vb +++ b/app/DD_PM_WINDREAM/frmUserKonfig_AddUsers.vb @@ -13,6 +13,7 @@ Public Class frmUserKonfig_AddUsers Dim XMLPath = System.IO.Path.Combine(Application.UserAppDataPath(), Filename) GridViewUsers.SaveLayoutToXml(XMLPath) Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in SaveGrid_Layout:" & vbNewLine & ex.Message) End Try End Sub @@ -40,6 +41,7 @@ Public Class frmUserKonfig_AddUsers 'DT_GROUPS_EXCLUSIVE = ClassDatabase.Return_Datatable(sql) GetGroups(USER_USERNAME) Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in Load Groups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try Try @@ -51,6 +53,7 @@ Public Class frmUserKonfig_AddUsers GridViewUsers.ClearSelection() End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in Load Grid_Layout:" & vbNewLine & ex.Message) End Try Cursor = Cursors.Default @@ -78,6 +81,7 @@ Public Class frmUserKonfig_AddUsers Next Return groups Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in GetActiveDirectoryGroups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return Nothing End Try @@ -114,6 +118,7 @@ Public Class frmUserKonfig_AddUsers Try newUserRow("Username") = userldap.SamAccountName Catch ex As Exception + LOGGER.Error(ex) newUserRow("Username") = user.ToString End Try Dim email As String = userldap.EmailAddress @@ -121,7 +126,8 @@ Public Class frmUserKonfig_AddUsers newUserRow("Surname") = NAME newUserRow("Email") = email Catch ex As Exception - ClassLogger.Add("Unexpected Error in Read User LDAP-Configurations: " & vbNewLine) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Read User LDAP-Configurations: " & vbNewLine) End Try DT_ADD_USERS.Rows.Add(newUserRow) TBAD_UsersBindingSource.DataSource = DT_ADD_USERS @@ -144,12 +150,14 @@ Public Class frmUserKonfig_AddUsers Try PRENAME = row.Item(2) Catch ex As Exception + LOGGER.Error(ex) PRENAME = "" End Try Dim NAME As String = row.Item(3) Try NAME = row.Item(3) Catch ex As Exception + LOGGER.Error(ex) NAME = "" End Try @@ -157,6 +165,7 @@ Public Class frmUserKonfig_AddUsers Try email = row.Item(4) Catch ex As Exception + LOGGER.Error(ex) email = "" End Try Dim SQL @@ -165,7 +174,7 @@ Public Class frmUserKonfig_AddUsers If ClassDatabase.Execute_non_Query(SQL, False) = True Then Dim ID = ClassDatabase.Execute_Scalar("SELECT MAX(GUID) FROM TBDD_USER", CONNECTION_STRING) Dim msg = String.Format(">> USER {0}, {1} - {2} ADDED TO CONFIGURATION", NAME, PRENAME, USERNAME) - ClassLogger.Add(msg, False) + LOGGER.Info(msg, False) SQL = String.Format("INSERT INTO TBDD_USER_MODULES (USER_ID,MODULE_ID) VALUES ({0},(SELECT GUID FROM TBDD_MODULES WHERE SHORT_NAME = 'PM'))", ID) If ClassDatabase.Execute_non_Query(SQL, False) = False Then MsgBox("Attention: could not add user to module! - Please check the log.", MsgBoxStyle.Exclamation) @@ -204,6 +213,7 @@ Public Class frmUserKonfig_AddUsers Return True End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in UserExists: " & vbNewLine & ex.Message) Return False End Try @@ -284,9 +294,9 @@ Public Class frmUserKonfig_AddUsers And Not groupname.StartsWith("Einstellungen eingehender") And Not groupname.StartsWith("Windows-Auth") And Not groupname.StartsWith("Terminalserver-Liz") And Not groupname.StartsWith("Zulässige") And Not groupname.StartsWith("Abgelehnte") And Not groupname.StartsWith("Schreibgeschützte Domänen") _ And Not groupname.StartsWith("Klonbare") And Not groupname.StartsWith("PrivUser") And Not groupname.StartsWith("Protected User") And Not groupname.StartsWith("Dns") And Not groupname.StartsWith("DHCP") And Not groupname.StartsWith("IIS_IUSR") And Not groupname.StartsWith("Richtlinien-Ersteller") _ And Not groupname.StartsWith("Abgelehnte RODC-Kenn") And Not groupname.StartsWith("Reporting") Then - ' Console.WriteLine(CStr(sidResult.Properties("name")(0))) - lbGroups.Items.Add(groupname) - End If + ' Console.WriteLine(CStr(sidResult.Properties("name")(0))) + lbGroups.Items.Add(groupname) + End If ' End If 'End If @@ -297,6 +307,7 @@ Public Class frmUserKonfig_AddUsers lblgroup_refresh() End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in GetGroups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try Cursor = Cursors.Default @@ -325,6 +336,7 @@ Public Class frmUserKonfig_AddUsers lblgroup_refresh() End If Catch ex As Exception + LOGGER.Error(ex) MsgBox("Error in Load Groups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try Cursor = Cursors.Default diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index 03c8a2f..91bb25e 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -83,6 +83,7 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler in set_foreground: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:") End Try @@ -96,7 +97,8 @@ Public Class frmValidator My.Settings.frmValidatorPosition = Me.Location My.Settings.Save() Catch ex As Exception - ClassLogger.Add("Error in Load FormLayout: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Error in Load FormLayout: " & ex.Message) End Try Select Case Path.GetExtension(Windream_Document_Path).ToLower Case ".pdf" @@ -117,11 +119,13 @@ Public Class frmValidator End Select My.Settings.Save() Catch ex As Exception +LOGGER.Error(ex) End Try Try TBPM_FILES_USER_NOT_INDEXEDTableAdapter.CmdDelete(Environment.UserName) Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Übersprungene Files löschen:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try @@ -129,6 +133,7 @@ Public Class frmValidator Try TBPM_PROFILE_FILESTableAdapter.CmdSETWORK(False, "", CURRENT_DOC_GUID) Catch ex As Exception +LOGGER.Error(ex) allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Fehler bei Freigabe der Dok-ID: " & CURRENT_DOC_GUID & " - ERROR: " & ex.Message, Environment.UserName) End Try End If @@ -168,6 +173,7 @@ Public Class frmValidator End If Next Catch ex As Exception +LOGGER.Error(ex) End Try End Sub @@ -189,6 +195,7 @@ Public Class frmValidator Next Catch ex As Exception +LOGGER.Error(ex) End Try End Sub @@ -203,7 +210,8 @@ Public Class frmValidator Return False End If Catch ex As Exception - ClassLogger.Add(">> Fehler in process_User_exists: " & ex.Message, True) + LOGGER.Error(ex) + LOGGER.Info(">> Fehler in process_User_exists: " & ex.Message, True) Return False End Try End Function @@ -222,7 +230,7 @@ Public Class frmValidator ' Next ' Return False ' Catch ex As Exception - ' ClassLogger.Add(">> Fehler in process_terminate: " & ex.Message, True) + ' LOGGER.Info(">> Fehler in process_terminate: " & ex.Message, True) ' End Try 'End Function Sub Close_PDF_Viewer(vorherigefile As String) @@ -259,6 +267,7 @@ Public Class frmValidator pdfxchange = False sumatra = True Catch ex As Exception +LOGGER.Error(ex) End Try End If @@ -268,8 +277,9 @@ Public Class frmValidator sumatra = False End If Catch ex As Exception - ClassLogger.Add("Fehler in Close_PDFXCHANGE") - ClassLogger.Add(ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Fehler in Close_PDFXCHANGE") + LOGGER.Info(ex.Message) End Try End Sub Private Function Init_windream() @@ -280,12 +290,13 @@ Public Class frmValidator '_windreamPM.Create_Session() '_windream = New ClassWindream_allgemein '_windream.Create_Session() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Windream initiiert", False) + LOGGER.Debug(" >> Windream initiiert", False) Return True Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error Init_windream:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Init _windream: " & ex.Message, Environment.UserName) - ClassLogger.Add(">> Fehler in Init_windream: " & ex.Message, True) + LOGGER.Info(">> Fehler in Init_windream: " & ex.Message, True) Return False End Try End Function @@ -328,11 +339,12 @@ Public Class frmValidator _step = 4 TBPM_CONTROL_TABLETableAdapter.FillAll(DD_DMSLiteDataSet.TBPM_CONTROL_TABLE) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Profile Data geladen", False) + LOGGER.Debug(" >> Profile Data geladen", False) Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error LOADING profile-data(" & _step.ToString & "):" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error LOADING profile-data: " & ex.Message, Environment.UserName) - ClassLogger.Add(">> Fehler in LOADING profile-data: " & ex.Message, True) + LOGGER.Info(">> Fehler in LOADING profile-data: " & ex.Message, True) Me.Close() End Try @@ -341,7 +353,7 @@ Public Class frmValidator If CURRENT_DT_PROFILE.Rows.Count = 0 Then - ClassLogger.Add(">> Profildaten konnten nicht geladen werden - Übergebenes Profil: : " & CURRENT_ProfilName, True) + LOGGER.Info(">> Profildaten konnten nicht geladen werden - Übergebenes Profil: : " & CURRENT_ProfilName, True) MsgBox("Achtung: Profildaten konnten nicht übergeben oder geladen werden.", MsgBoxStyle.Critical, "Achtung:") Me.Close() End If @@ -378,11 +390,12 @@ Public Class frmValidator Else btnSave.Text = "Validierung speichern - Nächstes Dokument" & " (F1)" End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Final profile Text geladen", False) + LOGGER.Debug(" >> Final profile Text geladen", False) Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error loading final profile text:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error loading final profile text: " & ex.Message, Environment.UserName) - ClassLogger.Add(">> Fehler in loading final profile text: " & ex.Message, True) + LOGGER.Info(">> Fehler in loading final profile text: " & ex.Message, True) End Try ToolStripButtonJumpFile.Enabled = True If CURRENT_JUMP_DOC_GUID <> 0 Then @@ -395,15 +408,15 @@ Public Class frmValidator Next If LOG_ERRORS_ONLY = False Then - ClassLogger.Add(" >> Profildaten gespeichert", False) - ClassLogger.Add(" >> WD_Search: " & WD_Search, False) - ClassLogger.Add(" >> finalProfile: " & finalProfile, False) - ClassLogger.Add(" >> Move2Folder: " & Move2Folder, False) - ClassLogger.Add(" >> Right_Delete: " & USER_RIGHT_FILE_DELETE, False) + LOGGER.Info(" >> Profildaten gespeichert", False) + LOGGER.Info(" >> WD_Search: " & WD_Search, False) + LOGGER.Info(" >> finalProfile: " & finalProfile, False) + LOGGER.Info(" >> Move2Folder: " & Move2Folder, False) + LOGGER.Info(" >> Right_Delete: " & USER_RIGHT_FILE_DELETE, False) End If PROFIL_sortbynewest = CURRENT_DT_PROFILE.Rows(0).Item("SORT_BY_LATEST") - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> PROFIL_sortbynewest: " & PROFIL_sortbynewest.ToString, False) + LOGGER.Debug(" >> PROFIL_sortbynewest: " & PROFIL_sortbynewest.ToString, False) 'Delete Button anzeigen ja/nein If USER_RIGHT_FILE_DELETE = True Then ToolStripButtonDeleteFile.Enabled = True @@ -411,7 +424,7 @@ Public Class frmValidator ToolStripButtonDeleteFile.Enabled = False End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Right_Delete: " & USER_RIGHT_FILE_DELETE.ToString, False) + LOGGER.Debug(" >> Right_Delete: " & USER_RIGHT_FILE_DELETE.ToString, False) Load_Controls() @@ -428,9 +441,10 @@ Public Class frmValidator Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error LOADING Profile-Data1:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error LOADING(2) Profile-Data: " & ex.Message, Environment.UserName) - ClassLogger.Add(">> Fehler in LOADING(2) Profile-Data: " & ex.Message, True) + LOGGER.Info(">> Fehler in LOADING(2) Profile-Data: " & ex.Message, True) End Try 'Me.lblerror.Visible = False @@ -461,7 +475,7 @@ Public Class frmValidator sql = clsPatterns.ReplaceUserValues(sqlStatement, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) sql = clsPatterns.ReplaceInternalValues(sql) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> sql after ReplaceInternalValues: " & sql, False) + LOGGER.Debug(">>> sql after ReplaceInternalValues: " & sql, False) 'sql = ClassPatterns.ReplaceInternalValues(sqlStatement) dt = ClassDatabase.Return_Datatable(sql) @@ -479,6 +493,7 @@ Public Class frmValidator control.Text = value oValue = value Catch ex As Exception +LOGGER.Error(ex) clsLogger.Add("Error in LoadSimpleData for TextBox: " & ex.Message) End Try ElseIf TypeOf control Is ComboBox Then @@ -492,6 +507,7 @@ Public Class frmValidator comboxBox.DataSource = list Catch ex As Exception +LOGGER.Error(ex) clsLogger.Add("Error in LoadSimpleData for Combobox: " & ex.Message) End Try ElseIf TypeOf control Is LookupControl Then @@ -500,6 +516,7 @@ Public Class frmValidator lookup.DataSource = dt Catch ex As Exception +LOGGER.Error(ex) clsLogger.Add("Error in LoadSimpleData for Lookupcontrol: " & ex.Message) End Try ElseIf TypeOf control Is DataGridView Then @@ -507,11 +524,13 @@ Public Class frmValidator Dim dataGridView As DataGridView = control dataGridView.DataSource = dt Catch ex As Exception +LOGGER.Error(ex) clsLogger.Add("Error in LoadSimpleData for DataGridView: " & ex.Message) End Try End If Next Catch ex As Exception +LOGGER.Error(ex) MsgBox("Error in LoadSimpleData: " & ex.Message, MsgBoxStyle.Critical) clsLogger.Add("Error in LoadSimpleData: " & ex.Message) End Try @@ -532,9 +551,9 @@ Public Class frmValidator Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper Case "TXT" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch TXT zu laden", False) + LOGGER.Debug(" >> Versuch TXT zu laden", False) Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(oControlRow, False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> TXT wurde geladen", False) + LOGGER.Debug(" >> TXT wurde geladen", False) AddHandler txt.GotFocus, AddressOf OnTextBoxFocus AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus @@ -542,10 +561,10 @@ Public Class frmValidator ctrl = txt Case "LBL" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch LBL zu laden", False) + LOGGER.Debug(" >> Versuch LBL zu laden", False) ctrl = ClassControlCreator.CreateExistingLabel(oControlRow, False) Case "CMB" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch CMB zu laden", False) + LOGGER.Debug(" >> Versuch CMB zu laden", False) Dim cmb = ClassControlCreator.CreateExistingCombobox(oControlRow, False) @@ -554,15 +573,15 @@ Public Class frmValidator #Region "CONTROL LIST" Dim ControlID = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, cmb.Name) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> In add_ComboBox - GUID: " & ControlID, False) + LOGGER.Debug(" >> In add_ComboBox - GUID: " & ControlID, False) If ControlID > 0 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >>ControlID > 0", False) + LOGGER.Debug(" >>ControlID > 0", False) Dim ConID = Me.TBPM_PROFILE_CONTROLSTableAdapter.cmdgetConnectionID(ControlID) If ConID Is Nothing = False Then Dim commandsql = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> ConID Is Nothing = False", False) + LOGGER.Debug(" >> ConID Is Nothing = False", False) If ConID > 0 And commandsql <> "" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> CConID > 0 And TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID)", False) + LOGGER.Debug(" >> CConID > 0 And TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID)", False) Dim connectionString As String TBDD_CONNECTIONTableAdapter.FillByID(DD_DMSLiteDataSet.TBDD_CONNECTION, ConID) Dim DTConnection As DataTable = DD_DMSLiteDataSet.TBDD_CONNECTION @@ -575,7 +594,7 @@ Public Class frmValidator Else connectionString = "Data Source=" & drConnection.Item("SERVER") & ";Initial Catalog= " & drConnection.Item("DATENBANK") & ";User Id=" & drConnection.Item("USERNAME") & ";Password=" & drConnection.Item("PASSWORD") & ";" End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> ConnString Sql-Server: " & connectionString, False) + LOGGER.Debug(" >> ConnString Sql-Server: " & connectionString, False) Case "oracle" Dim conn As New OracleConnectionStringBuilder Dim connstr As String @@ -593,7 +612,7 @@ Public Class frmValidator connectionString = connstr Case Else - ClassLogger.Add(" - ConnectionType nicht integriert", False) + LOGGER.Info(" - ConnectionType nicht integriert", False) MsgBox("ConnectionType nicht integriert", MsgBoxStyle.Critical, "Bitte Konfiguration Connection überprüfen!") End Select Next @@ -615,7 +634,7 @@ Public Class frmValidator If clsPatterns.HasOnlySimplePatterns(sql) Then sql = clsPatterns.ReplaceInternalValues(sql) sql = clsPatterns.ReplaceControlValues(sql, pnldesigner) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> sql after HasOnlySimplePatterns: " & sql, False) + LOGGER.Debug(">>> sql after HasOnlySimplePatterns: " & sql, False) sqlCnn = New SqlClient.SqlConnection(connectionString) ' Try sqlCnn.Open() @@ -631,17 +650,18 @@ Public Class frmValidator sqlCnn.Close() End If Catch ex As Exception - ClassLogger.Add(" - Unvorhergesehener Fehler bei GetValues SQL - Fehler: " & vbNewLine & ex.Message) +LOGGER.Error(ex) + LOGGER.Info(" - Unvorhergesehener Fehler bei GetValues SQL - Fehler: " & vbNewLine & ex.Message) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei GetValues SQL:") End Try End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Else Row 571", False) + LOGGER.Debug(" >> Else Row 571", False) End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> AListe Handling", False) + LOGGER.Debug(" >> AListe Handling", False) Dim AListe As String = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetChoiceListName(ControlID) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> In add_ComboBox - AListe: " & AListe, False) + LOGGER.Debug(" >> In add_ComboBox - AListe: " & AListe, False) If AListe Is Nothing = False Then 'Dim liste = _windreamPM.GetValuesfromAuswahlliste(AListe) Dim liste = WINDREAM.GetValuesfromAuswahlliste(AListe) @@ -679,12 +699,12 @@ Public Class frmValidator 'add_ComboBox(dr.Item("GUID"), dr.Item("CTRL_NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), CInt(dr.Item("WIDTH")), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY"), dr.Item("LOAD_IDX_VALUE")) 'dr.Item("INDEX_NAME"), Case "DTP" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch DTP zu laden", False) + LOGGER.Debug(" >> Versuch DTP zu laden", False) ctrl = ClassControlCreator.CreateExistingDatepicker(oControlRow, False) 'add_DTP(dr.Item("GUID"), dr.Item("NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), CInt(dr.Item("WIDTH")), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY"), dr.Item("LOAD_IDX_VALUE")) 'dr.Item("INDEX_NAME"), Case "DGV" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch DGV zu laden", False) + LOGGER.Debug(" >> Versuch DGV zu laden", False) Dim dgv = ClassControlCreator.CreateExistingDataGridView(oControlRow, False) AddHandler dgv.RowValidating, AddressOf onDGVRowValidating @@ -692,7 +712,7 @@ Public Class frmValidator ctrl = dgv Case "LOOKUP" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch LOOKUP zu laden", False) + LOGGER.Debug(" >> Versuch LOOKUP zu laden", False) Dim lookup As LookupControl = ClassControlCreator.CreateExistingLookupControl(oControlRow, False) lookup.PreventDuplicates = oControlRow.Item("VKT_PREVENT_MULTIPLE_VALUES") @@ -707,12 +727,12 @@ Public Class frmValidator 'add_DGV(dr.Item("GUID"), dr.Item("CTRL_NAME"), dr.Item("HEIGHT"), dr.Item("WIDTH"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), dr.Item("READ_ONLY"), dr.Item("LOAD_IDX_VALUE")) 'dr.Item("INDEX_NAME"), Case "CHK" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Checkbox zu laden", False) + LOGGER.Debug(" >> Versuch Checkbox zu laden", False) ctrl = ClassControlCreator.CreateExisingCheckbox(oControlRow, False) 'add_Checkbox(dr.Item("GUID"), dr.Item("CTRL_NAME"), dr.Item("CTRL_TEXT"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), dr.Item("READ_ONLY"), dr.Item("LOAD_IDX_VALUE")) Case "TABLE" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Tabelle zu laden", False) + LOGGER.Debug(" >> Versuch Tabelle zu laden", False) Dim columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow) = (From r As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In DD_DMSLiteDataSet.TBPM_CONTROL_TABLE Where r.CONTROL_ID = oControlRow.Item("GUID") @@ -721,7 +741,7 @@ Public Class frmValidator ctrl = ClassControlCreator.CreateExistingTable(oControlRow, columns, False) 'add_TABLE(dr.Item("GUID"), dr.Item("CTRL_NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), dr.Item("WIDTH"), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY")) Case "LINE" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Linie zu laden", False) + LOGGER.Debug(" >> Versuch Linie zu laden", False) ctrl = ClassControlCreator.CreateExistingLine(oControlRow, False) End Select @@ -737,14 +757,15 @@ Public Class frmValidator LoadSimpleData(ctrl, oControlRow.Item("GUID")) Next - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Controls geladen", False) - ClassLogger.Add("", False) + LOGGER.Debug(" >> Controls geladen", False) + LOGGER.Info("", False) Catch ex As Exception +LOGGER.Error(ex) If LOG_ERRORS_ONLY = False Then MsgBox("Error Load_Controls: " & ex.Message, MsgBoxStyle.Critical, "Attention error:") allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Load_Controls: " & ex.Message, Environment.UserName) - ClassLogger.Add("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message) - ClassLogger.Add("", False) + LOGGER.Info("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message) + LOGGER.Info("", False) End Try @@ -803,7 +824,7 @@ Public Class frmValidator sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, aktivesDokument, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> sql after ReplaceAllValues: " & sql, False) + LOGGER.Debug(">>> sql after ReplaceAllValues: " & sql, False) '' Regulären Ausdruck zum Auslesen der Indexe definieren 'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}" '' einen Regulären Ausdruck laden @@ -814,7 +835,7 @@ Public Class frmValidator '' alle Vorkommen innerhalbd er Namenkonvention durchlaufen 'For Each element As Text.RegularExpressions.Match In elemente ' Try - ' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False) + ' If LogErrorsOnly = False Then LOGGER.Info(" >> element in RegeX: " & element.Value, False) ' Dim MyPattern = element.Value.Substring(2, element.Value.Length - 3) ' Dim input_value @@ -827,7 +848,7 @@ Public Class frmValidator ' End If ' sql_Statement = sql_Statement.ToString.Replace(element.Value, input_value) ' Catch ex As Exception - ' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message) ' End Try 'Next @@ -836,7 +857,8 @@ Public Class frmValidator _dependingControl_in_action = False End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) End Try Next @@ -844,7 +866,8 @@ Public Class frmValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message) End Try If box.Name = last_control.Name Then ' Abschluss() @@ -892,7 +915,8 @@ Public Class frmValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message) End Try Next @@ -900,7 +924,8 @@ Public Class frmValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message) End Try End Sub @@ -929,7 +954,7 @@ Public Class frmValidator sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, aktivesDokument, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) _Step = 3 - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> sql after ReplaceAllValues: " & sql, False) + LOGGER.Debug(">>> sql after ReplaceAllValues: " & sql, False) '' Regulären Ausdruck zum Auslesen der Indexe definieren 'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}" '' einen Regulären Ausdruck laden @@ -940,7 +965,7 @@ Public Class frmValidator '' alle Vorkommen innerhalbd er Namenkonvention durchlaufen 'For Each element As Text.RegularExpressions.Match In elemente ' Try - ' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False) + ' If LogErrorsOnly = False Then LOGGER.Info(" >> element in RegeX: " & element.Value, False) ' Dim MyPattern = element.Value.Substring(2, element.Value.Length - 3) ' Dim input_value @@ -954,11 +979,11 @@ Public Class frmValidator ' sql_Statement = sql_Statement.ToString.Replace(element.Value, input_value) ' Catch ex As Exception - ' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result ComboBox - ERROR: " & ex.Message) + ' LOGGER.Info("Unexpected Error in Checking control values for Variable SQL Result ComboBox - ERROR: " & ex.Message) ' End Try 'Next - 'If LogErrorsOnly = False Then ClassLogger.Add(">>> sql_Statement after replacement: " & sql_Statement) + 'If LogErrorsOnly = False Then LOGGER.Info(">>> sql_Statement after replacement: " & sql_Statement) _dependingControl_in_action = True _Step = 4 @@ -968,12 +993,14 @@ Public Class frmValidator End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Display SQL result (Combobox) for control: (" & _Step.ToString & ")" & ROW.Item(0).ToString & " - ERROR: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Display SQL result (Combobox) for control: (" & _Step.ToString & ")" & ROW.Item(0).ToString & " - ERROR: " & ex.Message) End Try Next End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Eventhandler Variable SQL Result ComboBox - ERROR: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result ComboBox - ERROR: " & ex.Message) End Try SendKeys.Send("{TAB}") @@ -1018,7 +1045,8 @@ Public Class frmValidator End If End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Depending_Control_Set_Result - ERROR: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Depending_Control_Set_Result - ERROR: " & ex.Message) MsgBox("Unexpected error: " & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -1040,7 +1068,7 @@ Public Class frmValidator If dr.Item("PROFIL_ID") = CURRENT_ProfilGUID And dr.Item("CTRL_NAME") = control.Name Then Dim check = dr.Item("SQL_UEBERPRUEFUNG") If IsDBNull(check) Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> SQL Check is not configured!", False) + LOGGER.Debug(" >> SQL Check is not configured!", False) Return True End If If check.ToString.Length > 0 And dr.Item("INDEX_NAME") <> "DD PM-ONLY FOR DISPLAY" Then @@ -1058,7 +1086,8 @@ Public Class frmValidator End If Next Catch ex As Exception - ClassLogger.Add("Unvorhergesehener Fehler bei CheckValueExists:" & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unvorhergesehener Fehler bei CheckValueExists:" & ex.Message) Return False End Try End Function @@ -1072,6 +1101,7 @@ Public Class frmValidator Proc.StartInfo = psi Proc.Start() Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler in ShowFile_UniversalViewer:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try @@ -1104,9 +1134,10 @@ Public Class frmValidator Thread.Sleep(500) Loop Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Open_PDFXCHANGE:") - ClassLogger.Add("Fehler in Open_PDFXCHANGE") - ClassLogger.Add(ex.Message) + LOGGER.Info("Fehler in Open_PDFXCHANGE") + LOGGER.Info(ex.Message) End Try End Sub Sub Open_Sumatra(AktuelleIndexfile As String) @@ -1119,9 +1150,10 @@ Public Class frmValidator Proc.StartInfo = psi Proc.Start() Catch ex As Exception +LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Open_Sumatra:") - ClassLogger.Add("Fehler in Open_Sumatra") - ClassLogger.Add(ex.Message) + LOGGER.Info("Fehler in Open_Sumatra") + LOGGER.Info(ex.Message) End Try End Sub Sub Open_PDF_withStandard() @@ -1162,7 +1194,7 @@ Public Class frmValidator Function Get_Next_GUID() As Integer Try Dim newGUID As Integer - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Old Document_Path: " & OLD_Document_Path, False) + LOGGER.Debug(" >> Old Document_Path: " & OLD_Document_Path, False) 'If PROFIL_sortbynewest = True Then ' newGUID = TBPM_PROFILE_FILESTableAdapter.cmdgetNextFile_GUID_Newest(CURRENT_ProfilGUID, OLD_Document_Path, Environment.UserName) 'Else @@ -1174,7 +1206,7 @@ Public Class frmValidator Windream_Document_Path = "" CURRENT_DOC_PATH = "" If newGUID > 0 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> newGUID: " & newGUID.ToString, False) + LOGGER.Debug(" >> newGUID: " & newGUID.ToString, False) Windream_Document_Path = TBPM_PROFILE_FILESTableAdapter.CmdGetFilePath_2_GUID(newGUID) Windream_Document_Path = Windream_Document_Path.Replace("W:", "\\windream\objects") Windream_Document_Path = Windream_Document_Path.Replace("K:", "\\windream\objects") @@ -1182,15 +1214,15 @@ Public Class frmValidator Filesystem_Document_Path = GetFilesystemDocumentPath(Windream_Document_Path) CURRENT_DOC_PATH = Windream_Document_Path - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Document_Path: " & Windream_Document_Path, False) + LOGGER.Debug(" >> Document_Path: " & Windream_Document_Path, False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Überprüfen ob File existiert?", False) + LOGGER.Debug(" >> Überprüfen ob File existiert?", False) Dim i As Integer = 0 Do While allgFunk.file_exists(Windream_Document_Path, _windream) = False And newGUID <> 0 i = i + 1 If i > 800 Then allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Get_Next_GUID - Datei nicht vorhanden!", Environment.UserName) - ClassLogger.Add(" >> ACHTUNG: Ausnahme in GetNextGUID - Datei nicht vorhanden", False) + LOGGER.Info(" >> ACHTUNG: Ausnahme in GetNextGUID - Datei nicht vorhanden", False) Dim Del = "DELETE FROM TBPM_PROFILE_FILES where GUID = " & newGUID ClassDatabase.Execute_non_Query(Del, True) errmessage = "Die windream-Datei existiert nicht!" @@ -1208,14 +1240,15 @@ Public Class frmValidator ' Document_Path = TBPM_PROFILE_FILESTableAdapter.CmdGetFilePath_2_GUID(newGUID) 'End If Else - ClassLogger.Add(" >> ACHTUNG: Ausnahme in GetNextGUID - Es konnte keine GUID abgerufen werden!", False) + LOGGER.Info(" >> ACHTUNG: Ausnahme in GetNextGUID - Es konnte keine GUID abgerufen werden!", False) newGUID = 0 End If Return newGUID Catch ex As Exception +LOGGER.Error(ex) errmessage = "Unvorhergesehener Fehler in Get_Next_GUID: " & ex.Message - ClassLogger.Add(">> Unvorhergesehener Fehler in Get_Next_GUID:: " & ex.Message, True) + LOGGER.Info(">> Unvorhergesehener Fehler in Get_Next_GUID:: " & ex.Message, True) Return 0 End Try @@ -1280,7 +1313,7 @@ Public Class frmValidator Sub Load_Next_Document(first As Boolean) aktivesDokument = Nothing - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> aktivesDokument nothing gesetzt", False) + LOGGER.Debug(" >> aktivesDokument nothing gesetzt", False) activate_controls(False) errmessage = "" Windream_Document_Path = "" @@ -1290,13 +1323,13 @@ Public Class frmValidator 'Me.lblerror.Visible = False _Indexe_Loaded = False - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> In Load_Next_Document", False) + LOGGER.Debug(" >> In Load_Next_Document", False) Try If first = True Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> First Document", False) + LOGGER.Debug(" >> First Document", False) aktivesDokument = Nothing Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Following Document ", False) + LOGGER.Debug(" >> Following Document ", False) docCounter += 1 End If @@ -1318,7 +1351,7 @@ Public Class frmValidator Filesystem_Document_Path = GetFilesystemDocumentPath(Windream_Document_Path) End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Dokument-GUID: '" & CURRENT_DOC_GUID.ToString & "'", False) + LOGGER.Debug(" >> Dokument-GUID: '" & CURRENT_DOC_GUID.ToString & "'", False) If CURRENT_DOC_GUID > 0 Then 'Beschriftung des Navigators 'lblNavigator_anzDok.Text = position & " of " & Anzahl_ValDoks & " files" @@ -1329,21 +1362,22 @@ Public Class frmValidator tsslblDocID.Text = "Document-ID: " & CURRENT_DOC_ID & " - DocGUID: " & CURRENT_DOC_GUID ' txtDateipfad.Text = Document_Path tstrlbl_Info.Text = "Datei " & docCounter.ToString & " von " & Anzahl_ValDoks.ToString - ClassLogger.Add(">> Validierung für Dokument '" & Windream_Document_Path & "' gestartet", False) + LOGGER.Info(">> Validierung für Dokument '" & Windream_Document_Path & "' gestartet", False) Try aktivesDokument = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, WINDREAM.NormalizePath(Windream_Document_Path)) Catch ex As Exception +LOGGER.Error(ex) allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Fehler bei Erzeugen windream-Objekt - DocGUID: " & CURRENT_DOC_GUID & " - ERROR: " & ex.Message, Environment.UserName) - ClassLogger.Add("Fehler bei Erzeugen windream-Objekt in (LoadNextDokument): " & ex.Message) - ClassLogger.Add("Error Number: " & Err.Number.ToString) + LOGGER.Info("Fehler bei Erzeugen windream-Objekt in (LoadNextDokument): " & ex.Message) + LOGGER.Info("Error Number: " & Err.Number.ToString) Dim _err1 As Boolean = False 'Nochmaliger Versuch windream zu initialiseren If Init_windream() = True Then Try aktivesDokument = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, Windream_Document_Path) Catch ex1 As Exception - ClassLogger.Add("Fehler bei 2. Versuch windream-Objekt: " & ex1.Message) + LOGGER.Info("Fehler bei 2. Versuch windream-Objekt: " & ex1.Message) errmessage = "1-Es besteht ein Problem beim Anmelden an windream - Bitte wenden Sie sich an Digital Data!" _err1 = True End Try @@ -1359,10 +1393,10 @@ Public Class frmValidator End Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Windream-Dokument geladen und gelockt", False) + LOGGER.Debug(" >> Windream-Dokument geladen und gelockt", False) errmessage = Windream_get_Doc_info() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Windream-Dok Info geholt", False) + LOGGER.Debug(" >> Windream-Dok Info geholt", False) If errmessage = "" Then Me.grpbxMailBody.Visible = False Me.grpBetreff.Visible = False @@ -1375,19 +1409,19 @@ Public Class frmValidator ToolStripButtonAnnotation.Visible = False End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Viewer geladen", False) + LOGGER.Debug(" >> Viewer geladen", False) FillIndexValues() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexmaske geladen", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add("", False) + LOGGER.Debug(" >> Indexmaske geladen", False) + LOGGER.Debug("", False) 'Nun im Vektoprindex loggen das das Profil geladen wurde 'If PROFIL_VEKTORINDEX <> "" Then ' Dim Profilstring = "DD-PM" & Delimiter & "Profil: '" & PROFIL_NAME & "'" & Delimiter & Environment.UserName & Delimiter & Now.ToString ' If Indexiere_VektorfeldPM(Profilstring, PROFIL_VEKTORINDEX) = False Then - ' If LogErrorsOnly = False Then ClassLogger.Add(" >> Profilname erfolgreich in Vektorfeld PM geschrieben", False) + ' If LogErrorsOnly = False Then LOGGER.Info(" >> Profilname erfolgreich in Vektorfeld PM geschrieben", False) ' 'Else ' ' errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message ' ' My.Settings.Save() @@ -1399,7 +1433,7 @@ Public Class frmValidator If PROFIL_LOGINDEX <> "" Then Dim Profilstring = "DD-PMlog" & Delimiter & "In Profil: '" & CURRENT_ProfilName & "' geladen" & Delimiter & Environment.UserName & Delimiter & Now.ToString If Indexiere_VektorfeldPM(Profilstring, PROFIL_LOGINDEX) = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Profilname erfolgreich in Vektorfeld LOG geschrieben", False) + LOGGER.Debug(" >> Profilname erfolgreich in Vektorfeld LOG geschrieben", False) 'Else ' errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message ' My.Settings.Save() @@ -1421,8 +1455,8 @@ Public Class frmValidator errormessage = errmessage frmError.ShowDialog() Else - ClassLogger.Add(" >> Ende des Profils - Kein weiteres Dokument!", False) - ClassLogger.Add("", False) + LOGGER.Info(" >> Ende des Profils - Kein weiteres Dokument!", False) + LOGGER.Info("", False) MsgBox("Kein weiteres Dokument gefunden - Ende des Profils!" & vbNewLine & "Das Formular wird nun geschlossen.", MsgBoxStyle.Information, "Hinweis:") activate_controls(True) Me.Close() @@ -1430,10 +1464,11 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler bei Load_Next_Document - DocGUID: " & CURRENT_DOC_GUID & " - ERROR: " & ex.Message, Environment.UserName) errormessage = "Unvorhergesehener Fehler bei Load_Next_Document:" & ex.Message My.Settings.Save() - ClassLogger.Add("Unvorhergesehener Fehler in Load_Next_Document: " & ex.Message) + LOGGER.Info("Unvorhergesehener Fehler in Load_Next_Document: " & ex.Message) frmError.ShowDialog() End Try End Sub @@ -1453,7 +1488,7 @@ Public Class frmValidator Case "internal" SplitContainer1.Panel2Collapsed = False PdfViewer1.LoadDocument(Filesystem_Document_Path) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Internal Viewer Path: " & Filesystem_Document_Path, False) + LOGGER.Debug(" >> Internal Viewer Path: " & Filesystem_Document_Path, False) PdfControls_visible(True) Me.Size = My.Settings.frmValidation_Size_PDFViewer 'PdfViewer1.ZoomFactor = PDFViewer_ZoomMode @@ -1548,8 +1583,9 @@ Public Class frmValidator Me.grpbxMailBody.Visible = True Me.grpBetreff.Visible = True Catch ex As Exception +LOGGER.Error(ex) errormessage = "Unvorhergesehener Fehler bei Show_Email:" & ex.Message - ClassLogger.Add("Unvorhergesehener Fehler in Show_Email: " & ex.Message) + LOGGER.Info("Unvorhergesehener Fehler in Show_Email: " & ex.Message) My.Settings.Save() frmError.ShowDialog() End Try @@ -1573,9 +1609,10 @@ Public Class frmValidator Try CURRENT_DOC_CREATION_DATE = aktivesDokument.GetVariableValue(INDEX_DMS_ERSTELLT) Catch ex As Exception +LOGGER.Error(ex) If ex.Message.Contains("Variable: " & INDEX_DMS_ERSTELLT & " not found!") Then - ClassLogger.Add("1. Ausnahme in Windream_get_Doc_info: Variable: " & INDEX_DMS_ERSTELLT & " not found", True) - ClassLogger.Add("1. Ausnahme-Fehler: " & ex.Message, False) + LOGGER.Info("1. Ausnahme in Windream_get_Doc_info: Variable: " & INDEX_DMS_ERSTELLT & " not found", True) + LOGGER.Info("1. Ausnahme-Fehler: " & ex.Message, False) If INDEX_DMS_ERSTELLT = "DMS Created" Then INDEX_DMS_ERSTELLT = "DMS erstellt" @@ -1597,18 +1634,19 @@ Public Class frmValidator CURRENT_DOC_CREATION_DATE = aktivesDokument.GetVariableValue(INDEX_DMS_ERSTELLT) Else - ClassLogger.Add("Fehler in Windream_get_Doc_info 1: " & ex.Message) + LOGGER.Info("Fehler in Windream_get_Doc_info 1: " & ex.Message) Return "Fehler in Windream_get_Doc_info 1: " & ex.Message End If End Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DMS-Erstellt aus WD: " & CURRENT_DOC_CREATION_DATE, False) + LOGGER.Debug(" >> DMS-Erstellt aus WD: " & CURRENT_DOC_CREATION_DATE, False) Try CURRENT_DOC_CREATION_TIME = aktivesDokument.GetVariableValue(INDEX_DMS_ERSTELLT_ZEIT) Catch ex As Exception +LOGGER.Error(ex) If ex.Message.Contains("Variable: " & INDEX_DMS_ERSTELLT_ZEIT & " not found!") Then - ClassLogger.Add("1. Ausnahme in Windream_get_Doc_info: Variable: " & INDEX_DMS_ERSTELLT_ZEIT & " not found", True) + LOGGER.Info("1. Ausnahme in Windream_get_Doc_info: Variable: " & INDEX_DMS_ERSTELLT_ZEIT & " not found", True) If INDEX_DMS_ERSTELLT = "DMS Created" Then INDEX_DMS_ERSTELLT = "DMS erstellt" @@ -1633,12 +1671,12 @@ Public Class frmValidator CURRENT_DOC_CREATION_TIME = aktivesDokument.GetVariableValue(INDEX_DMS_ERSTELLT_ZEIT) Else - ClassLogger.Add("Fehler in Windream_get_Doc_info 3: " & ex.Message) + LOGGER.Info("Fehler in Windream_get_Doc_info 3: " & ex.Message) Return "Fehler in Windream_get_Doc_info 3: " & ex.Message End If End Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DMSErstelltZeit aus WD: " & CURRENT_DOC_CREATION_TIME, False) + LOGGER.Debug(" >> DMSErstelltZeit aus WD: " & CURRENT_DOC_CREATION_TIME, False) If CURRENT_DOC_CREATION_TIME.Length > 11 Then CURRENT_DOC_CREATION_DATE = CURRENT_DOC_CREATION_DATE & " " & CURRENT_DOC_CREATION_TIME.Substring(10) @@ -1648,7 +1686,8 @@ Public Class frmValidator Return "" Catch ex As Exception - ClassLogger.Add("Fehler in Windream_get_Doc_info (GENERELL): " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Fehler in Windream_get_Doc_info (GENERELL): " & ex.Message) Return "Fehler in Windream_get_Doc_info (GENERELL): " & ex.Message End Try @@ -1825,8 +1864,9 @@ Public Class frmValidator If value Is Nothing Then value = "" Return value Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler in ReturnVektor_IndexValue: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - ClassLogger.Add("Fehler in ReturnVektor_IndexValue: " & ex.Message) + LOGGER.Info("Fehler in ReturnVektor_IndexValue: " & ex.Message) Return "" End Try @@ -1854,7 +1894,7 @@ Public Class frmValidator oIndexName = oWMIndexName Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE") - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> INDEX: " & oWMIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString, False) + LOGGER.Debug(" >> INDEX: " & oWMIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString, False) _CURRENT_INDEX_ARRAY(oCount, 0) = oWMIndexName Select Case oType @@ -1870,7 +1910,7 @@ Public Class frmValidator ' Wenn kein Index exisitiert, defaultValue laden oControl.Text = oDefaultValue _CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If Dim wertWD @@ -1883,12 +1923,12 @@ Public Class frmValidator wertWD = "" Else If wertWD.ToString = "System.Object[]" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> TextBox with VektorField: " & oWMIndexName, False) + LOGGER.Debug(" >> TextBox with VektorField: " & oWMIndexName, False) If wertWD.length = 1 Then wertWD = wertWD(0) _CURRENT_INDEX_ARRAY(oCount, 1) = wertWD(0) Else ' - ClassLogger.Add(" >> Vectorfield " & oWMIndexName & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & oWMIndexName & "' contains more then one value - First value will be used", False) wertWD = wertWD(0) _CURRENT_INDEX_ARRAY(oCount, 1) = wertWD(0) End If @@ -1902,12 +1942,13 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) errormessage = "Unvorhergesehener Fehler bei FillIndexValues TextBox:" & vbNewLine & ex.Message & vbNewLine & "Check Logfile" My.Settings.Save() frmError.ShowDialog() - ClassLogger.Add(">> Unvorhergesehener Fehler bei FillIndexValuesTextBox: " & ex.Message, True) - ClassLogger.Add(">> Controltype: " & oControlType, False) - ClassLogger.Add(">> Indexname windream: " & oIndexName, False) + LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndexValuesTextBox: " & ex.Message, True) + LOGGER.Info(">> Controltype: " & oControlType, False) + LOGGER.Info(">> Indexname windream: " & oIndexName, False) Exit Sub End Try @@ -1927,7 +1968,7 @@ Public Class frmValidator cmb.Text = oDefaultValue _CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If Dim wertWD @@ -1938,37 +1979,38 @@ Public Class frmValidator End If If wertWD Is Nothing Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Indexwert aus index {oWMIndexName}: Nothing", False) + LOGGER.Debug($" >> Indexwert aus index {oWMIndexName}: Nothing", False) If oDefaultValue = String.Empty Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Indexwert-defaultValue wurde nicht gefunden", False) + LOGGER.Debug($" >> Indexwert-defaultValue wurde nicht gefunden", False) cmb.SelectedIndex = -1 Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Indexwert-defaultValue wird geladen", False) + LOGGER.Debug($" >> Indexwert-defaultValue wird geladen", False) cmb.Text = oDefaultValue _CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue 'cmb.SelectedIndex = cmb.FindStringExact(defaultValue) End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Indexwert aus index {oWMIndexName}: {wertWD}", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Items in Combobox: {cmb.Items.Count}", False) + LOGGER.Debug($" >> Indexwert aus index {oWMIndexName}: {wertWD}", False) + LOGGER.Debug($" >> Items in Combobox: {cmb.Items.Count}", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Index Wert wurde gesetzt", False) + LOGGER.Debug($" >> Index Wert wurde gesetzt", False) cmb.Text = wertWD _CURRENT_INDEX_ARRAY(oCount, 1) = wertWD 'If cmb.Items.Count = 0 Then - ' If LogErrorsOnly = False Then ClassLogger.Add($" >> Index Wert wurde gesetzt", False) + ' If LogErrorsOnly = False Then LOGGER.Info($" >> Index Wert wurde gesetzt", False) ' cmb.Text = wertWD 'Else - ' If LogErrorsOnly = False Then ClassLogger.Add($" >> Index Wert wurde ausgewählt", False) + ' If LogErrorsOnly = False Then LOGGER.Info($" >> Index Wert wurde ausgewählt", False) ' cmb.SelectedIndex = cmb.FindStringExact(wertWD) 'End If End If End If Catch ex As Exception - ClassLogger.Add(">> Unvorhergesehener Fehler bei FillIndexValues(Combobox: " & cmb.Name & "): " & ex.Message, True) - ClassLogger.Add(">> Controltype: " & oControlType, False) - ClassLogger.Add(">> Indexname windream: " & oIndexName, False) +LOGGER.Error(ex) + LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndexValues(Combobox: " & cmb.Name & "): " & ex.Message, True) + LOGGER.Info(">> Controltype: " & oControlType, False) + LOGGER.Info(">> Indexname windream: " & oIndexName, False) errormessage = "Unvorhergesehener Fehler bei FillIndexValues(Combobox: " & cmb.Name & "): " & vbNewLine & ex.Message & vbNewLine & "Check Logfile" My.Settings.Save() frmError.ShowDialog() @@ -1984,10 +2026,10 @@ Public Class frmValidator End If If oWMIndexName Is Nothing = False Then If oLoadIndex = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> getting wmValue for Index {oWMIndexName}...", False) + LOGGER.Debug($" >> getting wmValue for Index {oWMIndexName}...", False) Dim wertWD = aktivesDokument.GetVariableValue(oWMIndexName) If wertWD Is Nothing = False Then @@ -1998,10 +2040,10 @@ Public Class frmValidator Case "TABLE" Dim dt As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = " & oControlId) Dim SpaltenWerte As String() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> {dt.Rows.Count} Columns configured for control {oControlId}.", False) + LOGGER.Debug($" >> {dt.Rows.Count} Columns configured for control {oControlId}.", False) If dt.Rows.Count > 1 Then For Each Zeile As Object In wertWD - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> vektorrow Value {Zeile.ToString}...", False) + LOGGER.Debug($" >> vektorrow Value {Zeile.ToString}...", False) SpaltenWerte = Split(Zeile, Delimiter) Select Case dt.Rows.Count Case 1 @@ -2059,10 +2101,10 @@ Public Class frmValidator End If If oWMIndexName Is Nothing = False Then If oLoadIndex = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) Exit Select End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> getting wmValue for Index {oWMIndexName}...", False) + LOGGER.Debug($" >> getting wmValue for Index {oWMIndexName}...", False) Dim wertWD = aktivesDokument.GetVariableValue(oWMIndexName) If wertWD Is Nothing = False Then @@ -2073,10 +2115,10 @@ Public Class frmValidator Case "TABLE" Dim dt As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = " & oControlId) Dim SpaltenWerte As String() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> {dt.Rows.Count} Columns configured for control {oControlId}.", False) + LOGGER.Debug($" >> {dt.Rows.Count} Columns configured for control {oControlId}.", False) If dt.Rows.Count > 1 Then For Each Zeile As Object In wertWD - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> vektorrow Value {Zeile.ToString}...", False) + LOGGER.Debug($" >> vektorrow Value {Zeile.ToString}...", False) SpaltenWerte = Split(Zeile, Delimiter) Dim oDataSource As DataTable = dgv.DataSource @@ -2140,7 +2182,7 @@ Public Class frmValidator End If End If Case "System.Windows.Forms.CheckBox" - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Loading checkbox.", False) + LOGGER.Debug(" >> Loading checkbox.", False) oControlType = "CheckBox" If oWMIndexName = "" Then MsgBox("Achtung fehlerhafte Konfiguration:" & vbNewLine & "Für das Control " & oControl.Name & " wurde KEIN INDEX hinterlegt!" & vbNewLine & "Bitte prüfen Sie den Formulardesigner!", MsgBoxStyle.Critical) @@ -2151,7 +2193,7 @@ Public Class frmValidator Dim chk As CheckBox = oControl If oLoadIndex = False Or oWMIndexName = "DD PM-ONLY FOR DISPLAY" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False) + LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False) If oDefaultValue <> String.Empty Then Dim result = False @@ -2166,7 +2208,7 @@ Public Class frmValidator End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Loading Index value from Windream.", False) + LOGGER.Debug(" >> Loading Index value from Windream.", False) Dim wertWD If oWMIndexName.StartsWith("[%VKT") And PROFIL_VEKTORINDEX <> "" Then wertWD = ReturnVektor_IndexValue(oWMIndexName) @@ -2176,33 +2218,33 @@ Public Class frmValidator If wertWD Is Nothing Then - ClassLogger.Add(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & oIndexName & "' ist nothing. Check defaultvalue", False) + LOGGER.Info(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & oIndexName & "' ist nothing. Check defaultvalue", False) chk.Checked = False Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Index value loaded: " & wertWD.ToString, False) + LOGGER.Debug(" >> Index value loaded: " & wertWD.ToString, False) _CURRENT_INDEX_ARRAY(oCount, 1) = wertWD.ToString If wertWD.ToString = "" Then - ClassLogger.Add(">> Versuch, default Value zu laden", False) + LOGGER.Info(">> Versuch, default Value zu laden", False) If oDefaultValue <> String.Empty Then Dim result = False If Boolean.TryParse(oDefaultValue, result) Then - ClassLogger.Add(">> defaultValue wurde geladen", False) + LOGGER.Info(">> defaultValue wurde geladen", False) chk.Checked = result Else chk.Checked = False End If Else - ClassLogger.Add(">> defaultValue war leer", False) + LOGGER.Info(">> defaultValue war leer", False) chk.Checked = False End If Else Dim _value If wertWD.ToString = "System.Object[]" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> CheckBoxValue with VektorField: " & oWMIndexName, False) + LOGGER.Debug(" >> CheckBoxValue with VektorField: " & oWMIndexName, False) If wertWD.length = 1 Then _value = wertWD(0) Else ' - ClassLogger.Add(" >> Vectorfield " & oWMIndexName & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & oWMIndexName & "' contains more then one value - First value will be used", False) _value = wertWD(0) End If Else @@ -2211,14 +2253,15 @@ Public Class frmValidator Try Select Case CBool(_value) Case True - ClassLogger.Add(">> CBool(_value) = True", False) + LOGGER.Info(">> CBool(_value) = True", False) chk.Checked = True Case Else - ClassLogger.Add(">> CBool(_value) = False", False) + LOGGER.Info(">> CBool(_value) = False", False) chk.Checked = False End Select Catch ex As Exception - ClassLogger.Add(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True) +LOGGER.Error(ex) + LOGGER.Info(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True) chk.Checked = False End Try End If @@ -2244,7 +2287,8 @@ Public Class frmValidator End If Catch ex As Exception - ClassLogger.Add(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & oIndexName & " - Fehler: " & vbNewLine & ex.Message) +LOGGER.Error(ex) + LOGGER.Info(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & oIndexName & " - Fehler: " & vbNewLine & ex.Message) MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl:") End Try @@ -2259,9 +2303,9 @@ Public Class frmValidator Dim wertWD Try If oWMIndexName.StartsWith("[%VKT") And PROFIL_VEKTORINDEX <> "" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DATE über PM-Vektor holen", False) + LOGGER.Debug(" >> DATE über PM-Vektor holen", False) wertWD = ReturnVektor_IndexValue(oWMIndexName) - ClassLogger.Add(">> DTP is """, False) + LOGGER.Info(">> DTP is """, False) Else wertWD = aktivesDokument.GetVariableValue(oWMIndexName) End If @@ -2271,14 +2315,15 @@ Public Class frmValidator If wertWD.ToString.Length > 0 Then Try tempdate = CDate(wertWD) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DATE konnte umgewandelt werden", False) + LOGGER.Debug(" >> DATE konnte umgewandelt werden", False) Catch ex As Exception +LOGGER.Error(ex) ValueDTP = tempdate - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DATE wurde auf heute gesetzt", False) + LOGGER.Debug(" >> DATE wurde auf heute gesetzt", False) End Try DTP.Text = tempdate Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DATE ist leer", False) + LOGGER.Debug(" >> DATE ist leer", False) ValueDTP = tempdate DTP.Text = tempdate End If @@ -2286,11 +2331,12 @@ Public Class frmValidator Catch ex As Exception +LOGGER.Error(ex) errormessage = "Unvorhergesehener Fehler bei DTP: " & vbNewLine & ex.Message - ClassLogger.Add(">> Unvorhergesehener Fehler bei FillIndex DTP: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString & vbNewLine & "Indexname: " & oWMIndexName, True) + LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndex DTP: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString & vbNewLine & "Indexname: " & oWMIndexName, True) frmError.ShowDialog() - ClassLogger.Add(">> Unvorhergesehener Fehler bei FillIndex DTP: " & ex.Message, True) + LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndex DTP: " & ex.Message, True) End Try @@ -2312,13 +2358,14 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) errormessage = "Unvorhergesehener Fehler bei FillIndexValues:" & vbNewLine & ex.Message & vbNewLine & "Check Logfile" My.Settings.Save() frmError.ShowDialog() - ClassLogger.Add(">> Unvorhergesehener Fehler bei FillIndexValues: " & ex.Message, True) - ClassLogger.Add(">> Controltype: " & oControlType, False) - ClassLogger.Add(">> Indexname windream: " & oIndexName, False) - ClassLogger.Add(">> Stacktrace: " & ex.StackTrace, False) + LOGGER.Info(">> Unvorhergesehener Fehler bei FillIndexValues: " & ex.Message, True) + LOGGER.Info(">> Controltype: " & oControlType, False) + LOGGER.Info(">> Indexname windream: " & oIndexName, False) + LOGGER.Info(">> Stacktrace: " & ex.StackTrace, False) End Try @@ -2348,14 +2395,15 @@ Public Class frmValidator End If End If Catch ex As Exception - ClassLogger.Add(" ### FEHLER in CloseDocView") - ClassLogger.Add("### " & ex.Message & " ###") +LOGGER.Error(ex) + LOGGER.Info(" ### FEHLER in CloseDocView") + LOGGER.Info("### " & ex.Message & " ###") End Try End Sub Sub Abschluss() btnSave.Enabled = False - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Abschluss für Dok: " & aktivesDokument.aName & " gestartet", False) + LOGGER.Debug(" >> Abschluss für Dok: " & aktivesDokument.aName & " gestartet", False) 'Eingaben auf Form überprüfen If Check_UpdateIndexe() = False Then 'lblerror.Visible = False @@ -2368,24 +2416,24 @@ Public Class frmValidator Dim dtfinal As DataTable = DD_DMSLiteDataSet.TBPM_PROFILE_FINAL_INDEXING If dtfinal.Rows.Count > 0 Then 'Jetzt finale Indexe setzen - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Finale(r) Index(e) für Dok: " & aktivesDokument.aName & " soll gesetzt werden", False) + LOGGER.Debug(" >> Finale(r) Index(e) für Dok: " & aktivesDokument.aName & " soll gesetzt werden", False) For Each dr As DataRow In dtfinal.Rows Dim value As String = dr.Item("VALUE").ToString If value.ToUpper = "SQL-Command".ToUpper Then '###### Indexierung mit variablen SQL ### - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexierung mit dynamischem SQL!", False) + LOGGER.Debug(" >> Indexierung mit dynamischem SQL!", False) Dim SQL_COMMAND = dr.Item("SQL_COMMAND") - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> SQL_COMMAND before ReplaceAllValues: " & SQL_COMMAND, False) + LOGGER.Debug(" >> SQL_COMMAND before ReplaceAllValues: " & SQL_COMMAND, False) SQL_COMMAND = clsPatterns.ReplaceAllValues(SQL_COMMAND, pnldesigner, aktivesDokument, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> SQL_COMMAND after ReplaceAllValues: " & SQL_COMMAND, False) + LOGGER.Debug(" >> SQL_COMMAND after ReplaceAllValues: " & SQL_COMMAND, False) Dim dynamic_value = ClassDatabase.Execute_Scalar(SQL_COMMAND, CONNECTION_STRING, True) If Not IsNothing(dynamic_value) Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add("DYNAMIC VALUE IS: " & dynamic_value.ToString, False) + LOGGER.Debug("DYNAMIC VALUE IS: " & dynamic_value.ToString, False) value = dynamic_value Else - ClassLogger.Add("ATTENTION: DYNAMIC VALUE IS NOTHING!") + LOGGER.Info("ATTENTION: DYNAMIC VALUE IS NOTHING!") End If Else If value.StartsWith("v") Then @@ -2405,13 +2453,13 @@ Public Class frmValidator result(0) = value Dim oIndexType = WINDREAM.GetTypeOfIndex(dr.Item("INDEXNAME")) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> oIndexType {oIndexType.ToString}", False) + LOGGER.Debug($" >> oIndexType {oIndexType.ToString}", False) If oIndexType > 4000 And oIndexType < 5000 Then 'If dr.Item("INDEXNAME").ToString.StartsWith("[%VKT") Then ' Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME")) 'Hier muss nun separat als Vektorfeld indexiert werden If Indexiere_VektorfeldPM(value, dr.Item("INDEXNAME")) = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> FINALER INDEX '" & dr.Item("INDEXNAME").ToString & "' WURDE ERFOLGREICH GESETZT", False) + LOGGER.Debug(" >> FINALER INDEX '" & dr.Item("INDEXNAME").ToString & "' WURDE ERFOLGREICH GESETZT", False) Else errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message My.Settings.Save() @@ -2419,10 +2467,10 @@ Public Class frmValidator _error = True End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Jetzt das indexieren", False) + LOGGER.Debug(" >> Jetzt das indexieren", False) If Indexiere_File(aktivesDokument, dr.Item("INDEXNAME"), result) = True Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> FINALER INDEX '" & dr.Item("INDEXNAME") & "' WURDE ERFOLGREICH GESETZT", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add("") + LOGGER.Debug(" >> FINALER INDEX '" & dr.Item("INDEXNAME") & "' WURDE ERFOLGREICH GESETZT", False) + LOGGER.Debug("") 'Nun das Logging If PROFIL_LOGINDEX <> "" Then Dim logstr = Return_LOGString(value, "DDFINALINDEX", dr.Item("INDEXNAME")) @@ -2444,7 +2492,7 @@ Public Class frmValidator ''Wenn kein Fehler nach der finalen Indexierung gesetzt wurde If _error = False Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Tabelle updaten und co", False) + LOGGER.Debug(" >> Tabelle updaten und co", False) 'Das Dokument freigeben und als editiert markieren Dim sql = String.Format("UPDATE TBPM_PROFILE_FILES SET IN_WORK = 0, WORK_USER = '{0}', EDIT = 1 WHERE GUID = {1}", Environment.UserName, CURRENT_DOC_GUID) ClassDatabase.Execute_non_Query(sql) @@ -2459,6 +2507,7 @@ Public Class frmValidator WORK_HISTORY_ENTRY = Nothing End If Catch ex As Exception +LOGGER.Error(ex) WORK_HISTORY_ENTRY = Nothing End Try @@ -2474,7 +2523,7 @@ Public Class frmValidator ' alle Vorkommen innerhalbd er Namenkonvention durchlaufen For Each element As System.Text.RegularExpressions.Match In elemente Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False) + LOGGER.Debug(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False) Dim CTRL_ID = element.Value.Substring(2, element.Value.Length - 3) CTRL_ID = CTRL_ID.Replace("CTRLID", "") Dim value_from_control @@ -2490,6 +2539,7 @@ Public Class frmValidator Try value_from_control = inctrl.Text Catch ex As Exception +LOGGER.Error(ex) value_from_control = String.Empty End Try @@ -2498,6 +2548,7 @@ Public Class frmValidator Try value_from_control = cmb.Text Catch ex As Exception +LOGGER.Error(ex) value_from_control = String.Empty End Try Case "System.Windows.Forms.DateTimePicker" @@ -2505,6 +2556,7 @@ Public Class frmValidator Try value_from_control = dtp.Value.ToString Catch ex As Exception +LOGGER.Error(ex) value_from_control = String.Empty End Try @@ -2513,6 +2565,7 @@ Public Class frmValidator Try value_from_control = chk.Checked Catch ex As Exception +LOGGER.Error(ex) value_from_control = String.Empty End Try End Select @@ -2523,7 +2576,8 @@ Public Class frmValidator WORK_HISTORY_ENTRY = WORK_HISTORY_ENTRY.ToString.Replace(element.Value, value_from_control) End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message) +LOGGER.Error(ex) + LOGGER.Info("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message) End Try Next If WORK_HISTORY_ENTRY.ToString.Contains("@DATE") Then @@ -2581,13 +2635,13 @@ Public Class frmValidator End If 'Validierungsfile löschen wenn vorhanden allgFunk.Delete_xffres(Windream_Document_Path, _windream) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Delete_xffres ausgeführt", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> All Input clear", False) + LOGGER.Debug(" >> Delete_xffres ausgeführt", False) + LOGGER.Debug(" >> All Input clear", False) Anzahl_validierte_Dok += 1 'tstrlbl_Info.Text = "Anzahl Dateien: " & TBPM_PROFILE_FILESTableAdapter.cmdGet_Anzahl(PROFIL_ID) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Anzahl hochgesetzt", False) - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Validierung erfolgreich abgeschlossen", False) - ClassLogger.Add("", False) + LOGGER.Debug(" >> Anzahl hochgesetzt", False) + LOGGER.Debug(" >> Validierung erfolgreich abgeschlossen", False) + LOGGER.Info("", False) If CURRENT_JUMP_DOC_GUID <> 0 Then Me.Close() Else @@ -2601,10 +2655,11 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) errormessage = "Unvorhergesehener Fehler bei Abschluss:" & ex.Message My.Settings.Save() frmError.ShowDialog() - ClassLogger.Add(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True) + LOGGER.Info(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True) End Try Else 'lblerror.Visible = True @@ -2629,7 +2684,8 @@ Public Class frmValidator Dim Bezeichner As String = VKTBezeichner.Replace("[%VKT", "") PM_String = "DD-PM" & Delimiter & Bezeichner & Delimiter & input & Delimiter & Environment.UserName & Delimiter & Now.ToString Catch ex As Exception - ClassLogger.Add(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True) +LOGGER.Error(ex) + LOGGER.Info(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True) PM_String = "DD-PM ERROR: " & ex.Message End Try Return PM_String @@ -2645,7 +2701,8 @@ Public Class frmValidator End If Catch ex As Exception - ClassLogger.Add(">> Fehler in Return_LOGString: " & ex.Message, True) +LOGGER.Error(ex) + LOGGER.Info(">> Fehler in Return_LOGString: " & ex.Message, True) PM_String = "DD-PM ERROR: " & ex.Message End Try Return PM_String @@ -2716,9 +2773,9 @@ Public Class frmValidator Dim ctrl = dr.Item("CTRL_NAME") 'Nur wenn der Name der Zeile entspricht und der Index READ_ONLY FALSE ist If dr.Item("CTRL_NAME") = inctrl.Name And (_READ_ONLY = False Or _SQL <> "") And _IDXName <> "DD PM-ONLY FOR DISPLAY" Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexierung für Control (" & CONTROL_ID & ") '" & ctrl & "' gestartet. Indexname '" & _IDXName & "'", False) + LOGGER.Debug(" >> Indexierung für Control (" & CONTROL_ID & ") '" & ctrl & "' gestartet. Indexname '" & _IDXName & "'", False) If _IDXName = "" Then - ClassLogger.Add(" >> Indexname is unexpected empty.", False) + LOGGER.Info(" >> Indexname is unexpected empty.", False) Continue For End If Dim Type As String = inctrl.GetType.ToString @@ -2777,7 +2834,7 @@ Public Class frmValidator If wertWD.Length = 1 Then wertWD = wertWD(0) Else ' - ClassLogger.Add(" >> Vectorfield " & _IDXName & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & _IDXName & "' contains more then one value - First value will be used", False) wertWD = wertWD(0) End If End If @@ -2818,6 +2875,7 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) End Try @@ -2843,7 +2901,7 @@ Public Class frmValidator If wertWD.Length = 1 Then wertWD = wertWD(0) Else ' - ClassLogger.Add(" >> Vectorfield " & _IDXName & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & _IDXName & "' contains more then one value - First value will be used", False) wertWD = wertWD(0) End If End If @@ -2884,10 +2942,11 @@ Public Class frmValidator End If End If Catch ex As Exception +LOGGER.Error(ex) Dim st As New StackTrace(True) st = New StackTrace(ex, True) MsgBox("Unvorhergesehener Fehler in Check_UpdateIndexe TextBox: " & vbNewLine & ex.Message & vbNewLine & "Line: " & st.GetFrame(0).GetFileLineNumber().ToString, MsgBoxStyle.Critical, "Error:") - ClassLogger.Add("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) + LOGGER.Info("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) Return True End Try @@ -2989,11 +3048,11 @@ Public Class frmValidator End If End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Value WD ('" & wertWD.ToString & "') = Input-value ('" & input.ToString & "')", False) + LOGGER.Debug(" >> Value WD ('" & wertWD.ToString & "') = Input-value ('" & input.ToString & "')", False) End If Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DateValue is 01.01.0001 00:00:00", False) + LOGGER.Debug(" >> DateValue is 01.01.0001 00:00:00", False) End If Case "System.Windows.Forms.CheckBox" Dim chk As CheckBox = inctrl @@ -3025,7 +3084,7 @@ Public Class frmValidator If ValueWD.Length = 1 Then _Value = ValueWD(0) Else ' - ClassLogger.Add(" >> Vectorfield " & _IDXName & "' contains more then one value - First value will be used", False) + LOGGER.Info(" >> Vectorfield " & _IDXName & "' contains more then one value - First value will be used", False) _Value = ValueWD(0) End If Else @@ -3142,7 +3201,7 @@ Public Class frmValidator Dim dgv As GridControl = inctrl Dim Zeilen As Integer = dgv.DataSource.Rows.Count - + 'Wenn kein Wert ausgewählt wurde und der Index aber gesetzt werden muss If _MUSSEINGABE = True And Zeilen = 0 Then missing = True @@ -3195,10 +3254,11 @@ Public Class frmValidator Return missing Catch ex As Exception +LOGGER.Error(ex) Dim st As New StackTrace(True) st = New StackTrace(ex, True) MsgBox("Unvorhergesehener Fehler in Check_UpdateIndexe: " & vbNewLine & ex.Message & vbNewLine & "Line: " & st.GetFrame(0).GetFileLineNumber().ToString, MsgBoxStyle.Critical, "Error:") - ClassLogger.Add("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) + LOGGER.Info("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True) Return True End Try @@ -3218,7 +3278,7 @@ Public Class frmValidator 'Das Array der Idnexwerte überprüfen If idxvalue Is Nothing = False Then If idxvalue.Length() > 1 Then - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False) Dim anzahl As Integer = 0 For Each indexvalue As String In idxvalue ReDim Preserve arrValue(anzahl) @@ -3226,7 +3286,7 @@ Public Class frmValidator anzahl += 1 Next Else - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) + LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False) ReDim Preserve arrValue(0) arrValue(0) = idxvalue(0).ToString End If @@ -3240,9 +3300,10 @@ Public Class frmValidator End If Catch ex As Exception +LOGGER.Error(ex) allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler beim Indexieren der Datei: " & _dok.aName & " - ERROR: " & ex.Message, Environment.UserName) idxerr_message = "unvorhergesehener Fehler in Indexiere_File: " & ex.Message.ToString - ClassLogger.Add(">> Unvorhergesehener Fehler bei Indexiere_File: " & ex.Message.ToString, True) + LOGGER.Info(">> Unvorhergesehener Fehler bei Indexiere_File: " & ex.Message.ToString, True) Return Err() End Try End Function @@ -3266,7 +3327,7 @@ Public Class frmValidator connectionString = "%ORProvider=OraOLEDB.Oracle;Data Source=" & drConnection.Item("SERVER") & ";User Id=" & drConnection.Item("USERNAME") & ";Password=" & drConnection.Item("PASSWORD") & ";OLEDB.NET=True;" ' connectionString = "%ORData Source=" & drConnection.Item("SERVER") & ";Persist Security Info=True;User Id=" & drConnection.Item("USERNAME") & ";Password=" & drConnection.Item("PASSWORD") & ";Unicode=True" Case Else - ClassLogger.Add(" - ConnectionType '" & drConnection.Item("SQL_PROVIDER") & "' nicht integriert", False) + LOGGER.Info(" - ConnectionType '" & drConnection.Item("SQL_PROVIDER") & "' nicht integriert", False) MsgBox("ConnectionType '" & drConnection.Item("SQL_PROVIDER") & "' nicht integriert", MsgBoxStyle.Critical, "Bitte Konfiguration Connection überprüfen!") End Select @@ -3274,7 +3335,8 @@ Public Class frmValidator Next Return connectionString Catch ex As Exception - ClassLogger.Add(" - Unvorhergesehener Fehler bei GetConnectionString - Fehler: " & vbNewLine & ex.Message) +LOGGER.Error(ex) + LOGGER.Info(" - Unvorhergesehener Fehler bei GetConnectionString - Fehler: " & vbNewLine & ex.Message) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei GetConnectionString:") Return "" End Try @@ -3316,19 +3378,20 @@ Public Class frmValidator Proc.EnableRaisingEvents = True Proc.StartInfo = psi Proc.Start() - ClassLogger.Add(" - Datei wurde geöffnet!", False) + LOGGER.Info(" - Datei wurde geöffnet!", False) Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Datei öffnen:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) - ClassLogger.Add("Fehler bei Datei öffnen: " & ex.Message, True) + LOGGER.Info("Fehler bei Datei öffnen: " & ex.Message, True) End Try End Sub Sub Datei_ueberspringen() Try - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Dokument überspringen", False) + LOGGER.Debug(" >> Dokument überspringen", False) Close_document_viewer() - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Doc Viewer geschlossen", False) + LOGGER.Debug(" >> Doc Viewer geschlossen", False) 'Das Dokument freigeben TBPM_PROFILE_FILESTableAdapter.CmdSETWORK(False, "", CURRENT_DOC_GUID) @@ -3336,10 +3399,11 @@ Public Class frmValidator TBPM_FILES_USER_NOT_INDEXEDTableAdapter.cmdInsert(Environment.UserName, CURRENT_ProfilGUID, Windream_Document_Path) End If - If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Dokument freigegeben", False) - ClassLogger.Add("", False) + LOGGER.Debug(" >> Dokument freigegeben", False) + LOGGER.Info("", False) Load_Next_Document(False) Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Überspringen:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub @@ -3361,6 +3425,7 @@ Public Class frmValidator End If End If Catch ex As Exception +LOGGER.Error(ex) MsgBox("Fehler bei Löschen windream-Datei:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try @@ -3376,17 +3441,19 @@ Public Class frmValidator aktivesDokument.unlock() End If aktivesDokument.Delete() - ClassLogger.Add(">> Manuelles Löschen: Datei " & aktivesDokument.aName & " erfolgreich gelöscht", False) + LOGGER.Info(">> Manuelles Löschen: Datei " & aktivesDokument.aName & " erfolgreich gelöscht", False) Return True Catch ex As Exception +LOGGER.Error(ex) MsgBox("Das windream-Objekt konnte nicht gelöscht werden!" & vbNewLine & vbNewLine & "Fehlermeldung:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) - ClassLogger.Add(" windream-Objekt konnte nicht gelöscht werden - Fehlermeldung: " & ex.Message, True) + LOGGER.Info(" windream-Objekt konnte nicht gelöscht werden - Fehlermeldung: " & ex.Message, True) Return False End Try End If Catch ex As Exception - ClassLogger.Add(" Fehler bei Delete_File", True) - ClassLogger.Add(">> Fehlermeldung: " & ex.Message, False) +LOGGER.Error(ex) + LOGGER.Info(" Fehler bei Delete_File", True) + LOGGER.Info(">> Fehlermeldung: " & ex.Message, False) Return False End Try End Function @@ -3469,6 +3536,7 @@ Public Class frmValidator Try pdfstatuslblPageNumber.Text = "Page " & PdfViewer1.CurrentPageNumber & "/" & PdfViewer1.PageCount Catch ex As Exception +LOGGER.Error(ex) End Try End Sub diff --git a/app/DD_PM_WINDREAM/frmValidatorSearch.vb b/app/DD_PM_WINDREAM/frmValidatorSearch.vb index 6191d32..a6def90 100644 --- a/app/DD_PM_WINDREAM/frmValidatorSearch.vb +++ b/app/DD_PM_WINDREAM/frmValidatorSearch.vb @@ -14,7 +14,8 @@ My.Settings.frmValidatorSearchPosition = Me.Location My.Settings.Save() Catch ex As Exception - ClassLogger.Add("Error in Save FormLayout: " & ex.Message) + LOGGER.Error(ex) + LOGGER.Info("Error in Save FormLayout: " & ex.Message) End Try End Sub