Search code examples
log4net.net-cf-3.5log4net-configuration

log4net is not saving to my log file


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


Solution

  • 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.