4

I have a windows service that executes pieces of code in a new AppDomain. This AppDomain is created just for executing this pieces of code then destroyed thereafter. I am using log4net for logging purpose since I like its simplicity and flexibility. It works just fine in the default AppDomain, but logging statements inside the newly create AppDomain don't get logged. Is this a limitation within log4net or it's just that I am not setting it up right.

Waliaula Makokha
  • 815
  • 1
  • 11
  • 21

1 Answers1

1

I think that should work but you need to initialize log4net for the new AppDomain. If you log to a file you may experience locking issues.

See also this question.

Community
  • 1
  • 1
Stefan Egli
  • 17,398
  • 3
  • 54
  • 75
  • Actually you are right. Since both loggers would be writing to the same file and that would definitely cause locking issues. I have already perused the link and I will try that and see whats up. – Waliaula Makokha Sep 20 '10 at 09:59