I’m having trouble seeing how I can use logging in my setup / install project.
I’ve got Log4net working on installed applications, but I can’t seem to log the install / uninstall process.
My main problem is with the logging config file.
I suppose it’s a bit of a chicken/egg scenario – theres no way for me to grab the just-installed logging file?
I have a method that finds the root directory of my app, using – AppDomain.CurrentDomain.SetupInformation.ApplicationBase
and i normally use this to locate the logging config file.
This directory however, during install, is not where it is installing (obviously) it is somewhere within the windows filesystem.
Does anybody have any ideas to this?
Consider configuring log4net in code and not using a file or storing the configuration as a file resource of your custom action assembly and using
XmlConfigurator.Configure(Stream configStream)overload.Of course if you want to reuse the configuration of the application this is not a clean solution.
Also checkout this question:
log4net pure code configuration with filter in c#