logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Riley" <bri...@DRWHoldings.com>
Subject Whitespace in Messages?
Date Thu, 06 Jul 2006 19:34:12 GMT
Hi,

I am trying to print some log messages containing spaces to a RollingLogFileAppender, and
the white space is getting compacted. Basically, I'm logging a string by doing something like
this in C#:

string str = String.Format("{0,-20} {1, -10}", string1, string2);

The log output has only one space between the two strings, rather than being padded out to
20 spaces as I was expecting. (I'm trying to print columns of information.)

Is this something I can turn off? If it's helpful, I've attached my log4net configuration
below.

Thanks
Bruce

  <log4net>
		<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
			<param name="File" value="Service.log" />
			<param name="AppendToFile" value="true" />
			<param name="MaxSizeRollBackups" value="3" />
			<param name="MaximumFileSize" value="100000000" />
			<param name="RollingStyle" value="Size" />
			<param name="StaticLogFileName" value="true" />
			<layout type="log4net.Layout.PatternLayout">
				<param name="Header" value="[BEGIN LOG]\r\n" />
				<param name="Footer" value="[END LOG]\r\n" />
				<param name="ConversionPattern" value="%d [%t] %-5p - %m%n" />
			</layout>
		</appender>
	
		<root>
			<level value="INFO" />
			<appender-ref ref="RollingLogFileAppender"/> 
		</root>		
  </log4net>

Mime
View raw message