Hi
I'm trying to use elmah (xml storage) to log errors from my
Silverlight client.
So, I made a WCF service, which is used by my client when an
unattended exception is raised.
This is my DataContract :
public class SilverlightErrorData
{
[DataMember]
public string Message { get; set; }
[DataMember]
public string StackTrace { get; set; }
[DataMember]
public string CustomData { get; set; }
}
The wcf service then use Elmah.ErrorLog.GetDefault
(HttpContext.Current).Log(new Exception([text made from the data in
the above contract])) to log the error.
It works well enough for the urgent debugging need i have, but I'm not
totally satisfied :
1) in the WCF function, HttpContext.Current is always null. I can't
also use Elmah.ErrorSignal.FromCurrentContext().Raise(). That must be
normal, even if I can find people using it with WCF
(
http://will.hughesfamily.net.au/20090505/making-wcf-and-elmah-play-nice-together/
)
2) the elmah log is not very nice. For example, the message and the
detail field are the same, whereas I'd like the stacktrace to be only
in the xml detail field. Is there a way to do that ?
I'm thinking about generating by myself an ELMAH xml log file, but it
seems dirty. Is there a better solution ?
Thanks,