I use log4net for logging in My ClassLibrary Project
I had done all the necessary configurations but log files are not created for me !!!
added reference to log4net.dll in project.
created FirstAddIn.xll.config as
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="C:\logfile.txt" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] – %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="FileAppender" />
</root>
</log4net>
</configuration>
added to Assembly.cs
[assembly: log4net.Config.XmlConfigurator(
ConfigFile = "FirstAddIn.xll.config", Watch = true)]
Then I call private static readonly ILog log = LogManager.GetLogger(typeof(ESIntegration));
log.info("testing");
This works without any error but log file is not getting created !!!
how can I make this work ?
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/exceldna/-/R8zxRnieTwkJ.
To post to this group, send email to
exce...@googlegroups.com.
To unsubscribe from this group, send email to
exceldna+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/exceldna?hl=en.