logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Whatmore <Steven.Whatm...@purefacts.com>
Subject RE: Controlling the log message format
Date Wed, 12 May 2010 13:52:21 GMT
You are correct the DebugAppender sends the output to the Visual Studio output window, the
ConsoleAppender happens to send the ouput to the Console or "Output" window in Eclipse - although
not 100% semantically correct to call them the same - they have the same end result (logging
to the IDE output window), which is extremely useful during development

-----Original Message-----
From: Radovan Raszka [mailto:raszka@hasam.cz] 
Sent: Wednesday, May 12, 2010 9:13 AM
To: Log4NET User
Subject: RE: Controlling the log message format

I think DebugAppender in log4net is something different you think ;-)))
There is ConsoleAppender in log4net which works correctly according to configuration and probably
corresponds to Java's ConsoleAppender.
I have never used DebugAppender, but it probably send its output to the Output window in Visual


-----Původní zpráva-----
Od: Steven Whatmore [mailto:Steven.Whatmore@purefacts.com] 
Odesláno: 12. května 2010 13:41
Komu: Log4NET User
Předmět: RE: Controlling the log message format


We have a very similar set of Appenders to the log4net (as expected since it is a port as
far as I know)

	JAVA					.NET

	ConsoleAppender			DebugAppender
	JDBCAppender			ADONetAppender
	DailyRollingFileAppender	RollingFileAppender

In fact I believe that most of the core Appenders included with log4j have a corresponding
counterpart in log4net

The configuration is slightly different depending on what version since the version that we
are currently using in log4j is using the older property file format as opposed to an XML
configuration file (but I believe the newer version of log4j has the XML configuration file
option), and the actual specification for the formats are specified in a different manner

As an example, here is the configuration option for the ConsoleAppender


    log4j.appender.DebugAppender.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c %M - %m\n

    <appender name="DebugAppender" type="log4net.Appender.DebugAppender">
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date %-5level [%thread] - %message%newline" />

and the root logger


    log4j.rootLogger=DEBUG, DebugAppender, DailyRollingFileAppender


        <level value="DEBUG" />
        <appender-ref ref="DebugAppender" />
        <appender-ref ref="RollingFileAppender" />

The similarities should be fairly obvious.


View raw message