Click here to Skip to main content
Rate this: bad
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 10:09am
Edited 8-May-12 8:22am
RBhar at 2-May-12 17:03pm
Is there a way I can debug it?
mark merrens at 2-May-12 18:42pm
Do the application have the correct permissions to the folders you have selected?
RBhar at 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
0 OriginalGriff 205
1 Sergey Alexandrovich Kryukov 185
2 jlopez788 144
3 Rob Philpott 100
4 Prakriti Goyal 97
0 OriginalGriff 6,837
1 Sergey Alexandrovich Kryukov 5,559
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505

Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 8 May 2012
Copyright © CodeProject, 1999-2014
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