Logging block - Custom trace listener

Jul 11, 2007 at 2:33 PM
Hi,

I've a problem with a custom trace listener. I've made this custom listener:


public class LogeadorPersonal : CustomTraceListener
{
public override void Write(string message)
{
.......
}

public override void WriteLine(string message)
{
.......
}
}


At web.conf, i've a template for that listener like this:

<add template="{timestamp} ,{message} ,{category} ,{priority} ,{eventid} ,{severity}, {title}, {machine} ,{appDomain} ,{processId} ,{processName} ,{win32ThreadId}, {threadName} ,{dictionary({key} - {value})}"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="FormatoDB" />

but when the log is executed and the debbuger try to execute the write method (public override void WriteLine(string message)), the format is wrong, it's not like the template i've made for it, it's like the default template.

What's wrong?

ver.: EnterpriseLibrary 3.0 (april)

Thanks in advance.