Hi Matt!
I tried your suggestion, but does not work :(.
Thanks!
Cícero
On Wed, Feb 27, 2008 at 2:04 PM, Lee, Matthew <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I think you might need to call the base element to actually perform the
> write of the event. Maybe something like this:
>
> namespace MyProject.Log
> {
> public class MyXMLLayout : log4net.Layout.XmlLayout
> {
> public override void Format(System.IO.TextWriter writer,
> LoggingEvent loggingEvent)
> {
>
> //test layout
> writer.Write("NEW LOG ENTRY");
> *base.Format(writer, loggingEvent);*
> }
> }
> }
>
>
> Thanks,
>
> Matt
>
> ________________________________
>
> From: Cícero Raupp Rolim [mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>
> ]
> Sent: Wednesday, February 27, 2008 10:50 AM
> To: Log4NET User
> Subject: Proprieraty Layout Problem
>
>
>
> Hi!
>
> I have one question again :D!
>
> In my project (for Compact .NET Framework), we need implement a specified
> layout to logger. First, we included the log4net library in project and we
> extended the Xml like below:
>
> using System;
> using System.Collections.Generic;
> using System.Text;
> using log4net;
> using log4net.Util;
> using log4net.Core;
>
> namespace MyProject.Log
> {
> public class MyXMLLayout : log4net.Layout.XmlLayout
> {
> public override void Format(System.IO.TextWriter writer,
> LoggingEvent loggingEvent)
> {
> //test layout
> writer.Write("NEW LOG ENTRY");
> }
> }
> }
>
> I compiled the project and add layout attribute in log4net config file,
> like this:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <log4net>
> <appender name="RollingFileAppender" type="
> log4net.Appender.RollingFileAppender">
> <bufferSize value="0" />
> <file value="mylog.txt" />
> <appendToFile value="true" />
> <maxSizeRollBackups value="5" />
> <maximumFileSize value="100KB" />
> <rollingStyle value="Size" />
> <staticLogFileName value="true" />
> <layout type="MyProject.Log.MyXMLLayout" />
> </appender>
> <root>
> <level value="ALL" />
> <appender-ref ref="RollingFileAppender" />
> </root>
> </log4net>
> </configuration>
>
>
> When I run my project, the mylog.txt not contains the logged events of
> system. If I restore the config file with layouts provided by log4net, the
> software works fine. We need something else to do work this proprietary
> layout?
>
> Sorry for my bad english :(.
>
> Thanks's
>
> Cícero
>
> This message and any files transmitted with it are confidential and are
> intended solely for the use of the individual or entity to whom they are
> addressed. If you have received this email in error, please delete the email
> and any files transmitted with it entirely from your computer.
>
>
>