Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET

My project structure is as bellow,

Solution 'ab.ABCD'(4project)

As per the refference How to use log4net[^]
I inserted the bellow code in web.config under D:\project\ABCD.web\

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<log4net debug="true">
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
        <file value="C:\\TestProj\\TestLog.txt" />
        <appendToFile value="true" />
        <rollingStyle value="Size" />
        <maxSizeRollBackups value="10" />
        <maximumFileSize value="10MB" />
        <staticLogFileName value="true" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
        <level value="DEBUG" />
        <appender-ref ref="RollingLogFileAppender" />

Where i need to put the code
'[assembly: log4net.Config.XmlConfigurator(ConfigFile="Web.config", Watch=true)]'
Arif Tk
Posted 8-Jan-13 19:11pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Inside the Properties you will get the file "AssemblyInfo.cs"
ariftk at 9-Jan-13 6:38am
There is no Properties under D:\project\ABCD.web\
IpsitaMishra at 9-Jan-13 23:56pm
you have mention in your qns itself
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Previously D:\project\ABCD.web\ was in the website format so that there was no file like Properties/AsemblyInfo.cs.Now i converted website to web application,now it is working fine.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 404
1 Nirav Prabtani 307
2 Abhinav S 210
3 PIEBALDconsult 160
4 Dave Kreskowiak 155
0 OriginalGriff 7,580
1 Sergey Alexandrovich Kryukov 6,806
2 Maciej Los 3,919
3 Peter Leow 3,693
4 CHill60 2,742

Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 13 Jan 2013
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