Logging in ArcGIS Pro Addin

557
1
Jump to solution
06-13-2018 06:45 AM
Highlighted
Occasional Contributor II

What would be the best way to add logging to my Addin? I found the EventLog class in the ArcGIS Pro 2.1 API Reference Guide , but EventLog.IsEnabled is false, and I have no idea how to enable it. Should I use a 3rd party library such as Log4Net?

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Contributor

EventLog is intended for logging when Pro is in diagnostic mode otherwise writing to the log is a no-op. ArcGIS Pro runs in diagnostic mode using the "/enablediagnostics" command line switch. ProConcepts-Framework#diagnostic-mode-event-logging. Output goes to an xml file in My Documents\ArcGIS\Diagnostics

If you want your logging always "on" (not just when Pro is in diagnostic mode) then using another logger is the way to go

View solution in original post

1 Reply
Highlighted
Esri Contributor

EventLog is intended for logging when Pro is in diagnostic mode otherwise writing to the log is a no-op. ArcGIS Pro runs in diagnostic mode using the "/enablediagnostics" command line switch. ProConcepts-Framework#diagnostic-mode-event-logging. Output goes to an xml file in My Documents\ArcGIS\Diagnostics

If you want your logging always "on" (not just when Pro is in diagnostic mode) then using another logger is the way to go

View solution in original post