WarnException/DebugException etc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WarnException/DebugException etc

PaulB2
Hello,

When I use:

static Logger Log = LogManager.GetLogger( "RecordSender.Config" );

then ...

try
{
...
}
catch(Exception ex)
{
    Config.Log.WarnException( "Deserialize", ex );
}

This is what is logged in my console:

2006-03-04 13:15:39.1681|WARN|RecordSender.Config|Deserialize

Why don't I get any information about the exception? If I use
Config.Log.Warn ( "Deserialize: {0}", ex.Message ); I get the info I
need.

This is my NLog.dll.nlog file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
    </configSections>
    <nlog autoReload="true">
        <targets>
            <target name="console" type="Console" />
        </targets>

        <rules>
            <logger name="RecordSender.Config"
levels="Debug,Info,Warn,Error,Fatal" writeTo="console" />
        </rules>
    </nlog>
</configuration>

Any help would be appreciated, and thanks for the great lib!

Paul


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
Reply | Threaded
Open this post in threaded view
|

Re: WarnException/DebugException etc

Jarek Kowalski
Administrator
There's ${exception} layout renderer for this.

See this:

http://www.nabble.com/Why-does-errorexception-not-log-the-exception-info-t1078098c6167.html

Jarek
----- Original Message -----
From: "paul" <[hidden email]>
To: <[hidden email]>
Sent: Saturday, March 04, 2006 2:16 PM
Subject: [Nlog-list] WarnException/DebugException etc


> Hello,
>
> When I use:
>
> static Logger Log = LogManager.GetLogger( "RecordSender.Config" );
>
> then ...
>
> try
> {
> ...
> }
> catch(Exception ex)
> {
>    Config.Log.WarnException( "Deserialize", ex );
> }
>
> This is what is logged in my console:
>
> 2006-03-04 13:15:39.1681|WARN|RecordSender.Config|Deserialize
>
> Why don't I get any information about the exception? If I use
> Config.Log.Warn ( "Deserialize: {0}", ex.Message ); I get the info I
> need.
>
> This is my NLog.dll.nlog file:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>    <configSections>
>        <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"
> />
>    </configSections>
>    <nlog autoReload="true">
>        <targets>
>            <target name="console" type="Console" />
>        </targets>
>
>        <rules>
>            <logger name="RecordSender.Config"
> levels="Debug,Info,Warn,Error,Fatal" writeTo="console" />
>        </rules>
>    </nlog>
> </configuration>
>
> Any help would be appreciated, and thanks for the great lib!
>
> Paul
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd_______________________________________________
> Nlog-list mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/nlog-list
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
NLog Blog