Hi Richard,
As for the ASP.NET 2.0, it does provide simplified approach for us to
router/redirect trace message between the diagnostic trace and asp.ne
Trace. However, the redirection is depend on the underlying interface
support. For example, Diagnostic trace provide the <listeners> section to
let us register other listener so that we can redirect disgnostic trace to
ASP.NET page trace. However, if what you want is redirecting the logging
application block's trace to the asp.net page trace, I think this depend on
the interface and customization feature of the Logging Applcation block,
have you checked to see whether the 2.0 logging block provide such
configuration to plug a custom output listener?
Anyway, we can write trace to page TraceContext in our own class library
through the HttpContext.Current property. And the built-in
WebPageTraceListner just use the following code to flush trace into WebPage
TraceContext:
===================
public override void TraceEvent(TraceEventCache eventCache, string source,
TraceEventType severity, int id, string message)
{
if ((base.Filter == null) || base.Filter.ShouldTrace(eventCache,
source, severity, id, message, null, null, null))
{
HttpContext context1 = HttpContext.Current;
if (context1 != null)
{
string text1 = string.Concat(new object[] {
SR.GetString("WebPageTraceListener_Event"), " ", id, ": ", message });
if (severity <= TraceEventType.Warning)
{
context1.Trace.WarnInternal(source, text1, false);
}
else
{
context1.Trace.WriteInternal(source, text1, false);
}
}
}
}
======================
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)