Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following in my log4net_config.xml.
But the logfile is not being created.

XML
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
    <appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
        <!--Use a relative path for the log file-->
        <file value="D:/Dev/Logs/InformationServices-log-file.txt" />
        <appendToFile value="true" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
        </layout>
        <appendToFile value="true" />
        <rollingStyle value="Size" />
        <maximumFileSize value="1MB" />
        <maxSizeRollBackups value="4" />
        <staticLogFileName value="true" />
    </appender>
    <root>
        <level value="DEBUG" />
        <appender-ref ref="FileAppender" />
    </root>
</log4net>


The following code is written to configure the log file in the web service:
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(dir + "\\log4net_config.xml"));
Posted
Updated 8-May-12 8:22am
v2
Comments
RBhar 2-May-12 17:03pm    
Is there a way I can debug it?
R. Giskard Reventlov 2-May-12 18:42pm    
Do the application have the correct permissions to the folders you have selected?
RBhar 4-May-12 12:15pm    
Yes. It has the permissions!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900