Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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:
http://stackoverflow.com/questions/576456/log4net-versus-tracesource

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

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

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

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
thanks. that's pretty much what I'm currently doing except that I use my own config file instead app config. –  Jay Cummins Oct 13 '10 at 14:40
    
Yeah if I was doing it [I don't use ESRI] I would use my own config file and leave it with the plugin in it's folder, and let the assembly just watch for that file. –  Nathan W Oct 14 '10 at 0:10

Because log4net is a popular logging framework for .Net, you can run into problems if other ArcMap extensions are using the same version or log4net that you are. In that case you can run into some crossed wires in terms of configuration and static methods such as LogManager.Shutdown.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.