exception stacktrace .net cf 2.0

3 messages Options
Embed this post
Permalink
bobpf

exception stacktrace .net cf 2.0

Reply Threaded More More options
Print post
Permalink
Hope someone can help.  For the life of me I can not get more than the message to be logged when using logger.XXXException("foo",anExceptionClass);

I have tried numerious variants of the layout...
${exception:format=tostring}
${exception}${newline}${stacktrace}
${exception:format=message,stacktrace:separator=*}
etc...

None of these seem to make any difference.  I am using NLog for .NET Compact Framework 2.0 1.0.0.505.

Any assistance would be greatly appreciated.
Jaroslaw Kowalski

Re: exception stacktrace .net cf 2.0

Reply Threaded More More options
Print post
Permalink
.NET Compact Framework doesn't have APIs necessary to capture stack traces so NLog has no public way of displaying them. I'm thinking of hooking into low-level APIs for NLog v2, but that's still in the planning stage.
bobpf

Re: exception stacktrace .net cf 2.0

Reply Threaded More More options
Print post
Permalink
Thanks for the quick reply.  I actually did some additional testing and was able to get it to successfully log the stack trace using:

[${longdate}][${level:uppercase=true}] ${logger} : ${message}${newline}${exception:format=Message, Type, ToString:separator=*}

I tried the this syntax earlier but it was all lower case which by looking at the Exception.cs I would not expect it to matter but apparently it does.

Thanks again.