Solved

log4net not logging. why?

Posted on 2014-10-03
4
189 Views
Last Modified: 2014-10-28
Hi;

I have the following log segment in my web.config:

<log4net>
    <appender name="A1" type="log4net.Appender.RollingFileAppender" >
      <file value="logs/jazz.log" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="10MB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="A1" />
    </root>
  </log4net>

Open in new window


I changed log level to ALL from but it's not logging anything. But the log lines are invoked during the debug. Logs directory is there but jazz.log is empty. What would be the reason?

Regards.
0
Comment
Question by:jazzIIIlove
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40361554
Does your log4net have rights to that folder?
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 40362154
you have configsection referring to log4net ? Did you call XmlConfigurator.Configure before logging ?
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 40363854
Hi guys;

Yes, everyone has full rights on the given folder.

  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>

Open in new window


No, I don't call, XmlConfigurator.Configure before logging. Where to call? I don't have AssemblyInfo.cs in my asp.net web application.

Regards.
0
 
LVL 25

Expert Comment

by:apeter
ID: 40363896
You can call in global.ascs file.  Also can we we see how you are instantiating ilog instance and how you are using that to log please?
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Search an image for an image 3 27
Hey!! 5 33
Expression Evaluater 3 24
Create a WebAPI using a generic return parameter 9 24
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now