Created
October 2, 2018 22:59
-
-
Save jkbryan/8fa2f96ea0623eb1645cd9f9c5d44a3f to your computer and use it in GitHub Desktop.
logging-example.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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