RE: How to access the current EventSource through Remoting
From: Stig De Feyter (stigdefeyter_at_hotmail.com)
Date: 04/20/04
- Next message: Cedric B: "How can I make EIF not slow down my request time?"
- Previous message: Lance Delano[MSFT]: "RE: UML Modeling using VSS"
- In reply to: Mike Hayton [MS]: "RE: How to access the current EventSource through Remoting"
- Next in thread: Mike Hayton [MS]: "RE: How to access the current EventSource through Remoting"
- Reply: Mike Hayton [MS]: "RE: How to access the current EventSource through Remoting"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Apr 2004 00:05:50 -0700
Mike,
Thanks for the answer. As you mentioned that "an event
will ALSO be raised out through the event source of name
MyRequestEventSource.Name", I understood that it is
possible to have multiple RequestEvenSources on a single
thread.
So I'll have to look in another direction to solve the
issue of how to use the "IsEnabledForType()". Maybe I do
need to instantiate every possible RequestEventSource (in
my remote application) to check if the tracing is enabled
for the specified EventSource. I thought I could access
the "only current running" RequestEventSource (which is
specified in the client application) to call
the "IsEnabledForType()"-method.
Maybe I could pass a parameter from the client
application to check if an event should actually be
raised or not (as you said), but is it also possible to
loop through all the "activated" EventSources (in the
remote application) that are specified in the calling
application (this way we can control it in the server
EI.config)-file)?
Thanks.
Stig De Feyter
>-----Original Message-----
>Hi there,
>
>First some background...
>
>When (on the client app) you go
>
> using (RequestTrace request = new RequestTrace
(MyRequestEventSource))
> {
> // Calls to remoting objects start here
> }
>
>The name of the request event source (i.e.
MyRequestEventSource.Name) is
>being put on the thread. It is this name (and some other
information like
>sequence count, request instance ID, etc) that is flowed
across to the
>remote objects.
>
>When an event is raised within the remote object (in the
remote process),
>the event will be also be raised out through the event
source of name
>MyRequestEventSource.Name.
>
>Note - The EI.config loaded in the remote process will
determine where
>events raised through MyRequestEventSource.Name are
actually routed - it is
>not the EI.config of the client process that initiated
the request trace.
>
>
>Now for your question....
>
>The CallContext.GetData() method is what you'd call to
access the
>LogicalCallContext. Attached is a sample that is
pulling out the request
>details an flowing them across web service calls (in the
http headers).
>
>However, Im not sure I understand what you would pass
into
>IsEnabledForType and what you would expect it to return.
>I suspect that you may want to leave the EI.config of
the remote process
>set to always log events and have some flag flow across
from the client
>process to indicate whether the event should actually be
raised or not. Is
>this correct?
>
>I hope this helps
>
>Mike
>
>--------------------
>| Hi there,
>|
>| I'm currently using the EIF to trace messages in our
remoting-enabled
>| application. I implemented the RequestTrace-class to
log context
>| specific information (like ComPlusInfo).
>| Now, I want to be able to use the "IsEnabledForType"
method in my
>| remote server application, but I don't know how to
access the
>| RequestEventSource of the calling application (which
is necessary to
>| execute the IsEnabledForType method).
>|
>| I use the following line of code (in my client
application) to
>| initiate the tracing:
>|
>| using (RequestTrace request = new RequestTrace
(MyRequestEventSource))
>| {
>| // Calls to remoting objects start here
>| }
>|
>| This way, "MyRequestEventSource" is passed to the
calling objects
>| through remoting and all the trace messages will be
logged under the
>| given EventSource. The following line of code will log
messages to the
>| sink specified in my EnterpriseInstrumentation.config -
file.
>|
>| TraceMessageEvent.Raise("Inside Method on Remote
Server" );
>|
>| This all works great, but the actions executed to
write to the event
>| sink are very costly and should only be executed when
tracing is
>| enabled. Here, the IsEnabledForType method should be
very useful.
>|
>| Some documentation pointed out that information
concerning the request
>| is stored in the "LogicalCallContext", but I can't
find how to access
>| this info.
>| The only event source I can use is the Application
Level Event
>| Source(RequestEventSource.Application), but this is
not the one I
>| need.
>| Who can help me with this one?
>|
>| Stig De Feyter
>|
>
>--
>
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>Use of included script samples are subject to the terms
specified at
>http://www.microsoft.com/info/cpyright.htm
- Next message: Cedric B: "How can I make EIF not slow down my request time?"
- Previous message: Lance Delano[MSFT]: "RE: UML Modeling using VSS"
- In reply to: Mike Hayton [MS]: "RE: How to access the current EventSource through Remoting"
- Next in thread: Mike Hayton [MS]: "RE: How to access the current EventSource through Remoting"
- Reply: Mike Hayton [MS]: "RE: How to access the current EventSource through Remoting"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|