Click here to Skip to main content
12,830,433 members (45,478 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" ?>
    <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" />
        <appendToFile value="true" />
        <rollingStyle value="Size" />
        <maximumFileSize value="1MB" />
        <maxSizeRollBackups value="4" />
        <staticLogFileName value="true" />
        <level value="DEBUG" />
        <appender-ref ref="FileAppender" />

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 11:09am
Updated 8-May-12 9:22am
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
Web01 | 2.8.170326.1 | Last Updated 8 May 2012
Copyright © CodeProject, 1999-2017
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