Wednesday 30 August 2017

arcobjects - What issues exist with using log4net as a logging framework for ArcGIS Desktop?


While updating some ArcObjects projects to ArcGIS 10, I realized that I don't have a comprehensive logging strategy. Sometimes it's log4net. Sometimes it's System Trace/Debug. Sometimes custom logging. Sometimes all three within in the same project.


log4net certainly seems to be popular. I use it and I have had no trouble with it, but I don't feel like I'm experienced enough with log4net to anticipate possible issues with its use.


This question is for ArcGIS Desktop only: AddIn or COM extensibility. I think the answers to the same question for ArcGIS Server might be different and deserve its own question and its own set of tags.


What issues exist with using log4net as a logging framework for ArcGIS Desktop?


Some related Stackoverflow.com questions:
https://stackoverflow.com/questions/576456/log4net-versus-tracesource


https://stackoverflow.com/questions/98080/what-is-the-best-logging-solution-for-a-c-net-3-5-project


https://stackoverflow.com/questions/2410438/log4net-performance


https://stackoverflow.com/questions/126540/what-is-your-net-logging-framework-of-choice




Answer



We have used log4net in several non-ESRI projects and a few ArcGIS Server projects and have found that it works quite well in terms of ease-of-use, configurability, and scaleability. I would think that for Desktop projects one issue would be placement/discovery of the configuration file. See Dave Bouwman's blog post on the topic for reference (applies to pre-10 projects). However, with the ArcGIS 10 add-in architecture and the use of well-known folders, I would think that this should no longer be an issue.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...