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 11:09am
Edited 8-May-12 9: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 476
1 Sergey Alexandrovich Kryukov 210
2 CHill60 195
3 F-ES Sitecore 120
4 TheRealSteveJudge 120
0 Sergey Alexandrovich Kryukov 9,061
1 OriginalGriff 7,920
2 Peter Leow 4,774
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,176

Advertise | Privacy | Mobile
Web03 | 2.8.150326.1 | Last Updated 8 May 2012
Copyright © CodeProject, 1999-2015
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