fix jobconfigparser, fix error in database->mssql, reduce logging for jobrunner

This commit is contained in:
Jonathan Jenne
2019-04-24 11:47:34 +02:00
parent 0bf0f8a05d
commit b387ff5376
6 changed files with 108 additions and 101 deletions

View File

@@ -150,7 +150,7 @@ Public Class ActiveDirectoryInterface
Using oContext As New PrincipalContext(ContextType.Domain)
Using oGroupPrincipal As GroupPrincipal = GroupPrincipal.FindByIdentity(oContext, IdentityType.Name, GroupName)
If oGroupPrincipal Is Nothing Then
_logger.Warn("Group {0} does not exist.", GroupName)
_logger.Debug("Group {0} does not exist.", GroupName)
Return oUsers
End If
@@ -181,7 +181,7 @@ Public Class ActiveDirectoryInterface
End If
Next
Else
_logger.Warn("Could not fetch CustomAttributes for user {0}", oUser)
_logger.Debug("Could not fetch CustomAttributes for user {0}", oUser)
End If
_logger.Debug("Trying to add User {0} to user list", oUser)

View File

@@ -24,7 +24,7 @@ Namespace SyncUsers
oGroupId = GetGroupId(GroupName)
If oGroupId = 0 Then
_logger.Warn("Group {0} does not exist in database. Exiting", GroupName)
_logger.Debug("Group {0} does not exist in database. Exiting.", GroupName)
Return oSyncedUsers
End If
@@ -46,7 +46,7 @@ Namespace SyncUsers
_logger.Debug("User {0} exists in database: {1}", oUser, oUserExists)
Catch ex As Exception
_logger.Error(ex)
_logger.Warn("Could not get UserId for user. Skipping")
_logger.Warn("Could not get UserId for user. Skipping.")
Continue For
End Try
@@ -59,7 +59,7 @@ Namespace SyncUsers
End If
Catch ex As Exception
_logger.Error(ex)
_logger.Warn("Could not create user. Skipping")
_logger.Warn("Could not create user. Skipping.")
Continue For
End Try
@@ -68,7 +68,7 @@ Namespace SyncUsers
AddCustomAttributesToUser(oUser, oUserId)
Catch ex As Exception
_logger.Error(ex)
_logger.Warn("Could not add custom attributes to user {0}. Continuing", oUser)
_logger.Debug("Could not add custom attributes to user {0}. Continuing.", oUser)
End Try
' Add the user to group
@@ -76,7 +76,7 @@ Namespace SyncUsers
AddUserToGroup(oUserId, oGroupId)
Catch ex As Exception
_logger.Error(ex)
_logger.Warn("Could not add user {0} to group {1}. Skipping", oUser, GroupName)
_logger.Warn("Could not add user {0} to group {1}. Skipping.", oUser, GroupName)
Continue For
End Try
@@ -106,7 +106,7 @@ Namespace SyncUsers
Dim oGroupId = _mssql.NewExecuteScalar(oSQL)
If IsDBNull(oGroupId) OrElse oGroupId = 0 Then
_logger.Debug("Group {0} not found in database", GroupName)
_logger.Debug("Group {0} not found in database.", GroupName)
Return 0
End If
@@ -158,7 +158,7 @@ Namespace SyncUsers
Dim oResult = _mssql.NewExecutenonQuery(oSQL)
If oResult = False Then
_logger.Warn("Custom Attribute {0} could not be added to user {1}", oAttribute.Name, User.samAccountName)
_logger.Debug("Custom Attribute {0} could not be added to user {1}", oAttribute.Name, User.samAccountName)
Continue For
End If
Next