Last post May 19, 2017 09:56 AM by Cathy Zou
May 19, 2017 12:20 AM|robby32|LINK
I have a web app and when an exception occurs i log the information to a file. But what is the difference between using Trace.Traceerror and Trace.TraceInformation ?
I can just log away the exception message using trace.information . Is that correct ? what advantage does trace.traceerror give ?
May 19, 2017 01:58 AM|JBetancourt|LINK
May 19, 2017 09:56 AM|Cathy Zou|LINK
TraceInformation (and the equivalent TraceWarning, TraceError) logs the "Event" that an Informational (or Warning or Error) trace has been provided (normally checking that that level of trace has been requested and with "headers", a newline
Trace.TraceError calls the TraceEvent method for each trace listener, with the trace event type Error and send a message to trace listener.
In tracing we can easily differentiate between message types (Information, Error, Warning)
using Trace.TraceInformation, Trace.TraceError and Trace.TraceWarning.