0

I am trying to implement log4net into my project but I am unable to get the logger to save to the file I have set. I run the program and make sure that the log4net is catching some things and then I check the file after closing the application and its not there. What am I missing? I have a config.xml already but I did not want to put my configuration for log4net in there so I have this one. any help would be appreciated!

enter image description here

enter image description here

enter image description here

Tyler Buchanan
  • 311
  • 1
  • 4
  • 18
  • I'm not sure what all the XmlConfigurator stuff is but I've never had to do that. Try just naming your log4net config file the same as your executable with .config on the end. Like, MyProgram.exe.config – Ash Burlaczenko Aug 16 '13 at 14:45

1 Answers1

0

In your configuration you are tell root to use DebugAppender and LogFileAppender but the only appender in the config is RollingFileAppender.

Either add this as a root child

<appender-ref ref="RollingFileAppender" />

Or add further appender tags with names of DebugAppender and LogFileAppender.

Ash Burlaczenko
  • 24,778
  • 15
  • 68
  • 99