|
From: Geoghegan, W. A (Willie) <wil...@in...> - 2010-10-13 17:57:45
|
If you have source code, try modifying Log4NetLogger.cs. There is a
line like this in the Fields region near the top of the file:
private readonly static Type declaringType = typeof(Log4NetLogger);
Try changing it to this:
private readonly static Type declaringType = typeof(AbstractLogger);
Note that I am using NLog right now, so I have not actually tried this
with log4net.
Willie.
-----Original Message-----
From: Seb...@gm... [mailto:Seb...@gm...]
Sent: Thursday, September 16, 2010 8:46 AM
To: net...@li...
Subject: [Netcommon-developer] How I get the method name?
Hi!
I am using Common.Looging 2.0 and Log4Net with a RollingFileAppender.
This works fine. Now I want to log the method name. So I adapted the
ConversionPattern. This is my config now and it does not log the method
names.
<configSections>
<sectionGroup name="common">
<section name="logging"
type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<common>
<logging>
<factoryAdapter
type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4net">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<log4net debug="false">
<appender name="RollingFileAppender"
type="log4net.Appender.RollingFileAppender, log4net" >
<param name="File" value="logs\Test.log" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Size" />
<param name="MaxSizeRollBackups" value="1" />
<param name="MaximumFileSize" value="10MB" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout, log4net">
<param name="ConversionPattern" value="%date{dd.MM.yyyy
HH:mm:ss,fff} - %4thread - %-5level - %logger - %class.%method :
%message%newline" />
</layout>
</appender>
<root>
<priority value="ALL" />
<appender-ref ref="RollingFileAppender" />
</root>
</log4net>
And this is the corresponding log, I miss the "Main()" method name.
16.09.2010 15:27:46,739 - 10 - DEBUG - ConsoleApplication1.Program -
Common.Logging.Factory.AbstractLogger.Debug : testmessage
What am I doing wrong?
--
Hi, ich bin SeboStone!
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
------------------------------------------------------------------------
------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Netcommon-developer mailing list
Net...@li...
https://lists.sourceforge.net/lists/listinfo/netcommon-developer
|