2

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

2 Answers 2

4

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.

2
  • thanks. that's pretty much what I'm currently doing except that I use my own config file instead app config. Commented Oct 13, 2010 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
    Commented Oct 14, 2010 at 0:10
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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