Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
logging-example.vb
'Within the "Public Class MAExtensionObject" section, add:
'Date & Logginglevel variables for logging files:
Dim dtDateNowDay As Integer = Date.Now.Day
Dim dtDateNowMonth As Integer = Date.Now.Month
Dim dtDateNowYear As Integer = Date.Now.Year
Dim loggingLevel As Integer = 0
'================================================
'With the Sub or Function that you want logging - e.g. "Public Sub MapAttributesForImport"
Dim dtFileTime As DateTime
'Define Logfile Name then setup the logfile
Dim logFileName As String = dtDateNowDay & "-" & dtDateNowMonth & "-" & dtDateNowYear & "_MyMA_Import.log"
Logging.SetupLogFile(logFileName, loggingLevel)
'================================================
'Within a sync rule, where you want to log something - e.g. what the UPN is going to be set to:
Logging.Log("Some informational string," & csentry("samAccountName").Value & ",UPN," & csentry("mail").Value, True, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.