Click here to Skip to main content
12,290,051 members (69,439 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
I have the following in my log4net_config.xml.
But the logfile is not being created.

<?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 2-May-12 10:09am
RBhar314
Edited 8-May-12 8:22am
v2
Comments
RBhar 2-May-12 17:03pm
   
Is there a way I can debug it?
mark merrens 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160518.1 | Last Updated 8 May 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100