Solved

log4net not logging. why?

Posted on 2014-10-03
4
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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