ILogReceiverServer custom parameters

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ILogReceiverServer custom parameters

fleed
Hi,

is it possible to send custom parameters to the ILogReceiverServer service?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: ILogReceiverServer custom parameters

fleed
Well, I was able to get index-based parameters on the ILogReceiverServer service, but is it possible to maintain the names of the parameters (I would like to populate the LogEventInfo.Properties dictionary on the service)?

For instance, if I sender a parameter named "sender" with a string representing the log message sender

<targets>
      <target xsi:type="LogReceiverService"
          name="wcf"
          endpointAddress="http://localhost.:8008/LogReceiver.svc"
              clientID="{guid:cached=true}">
          <parameter name="guid" layout="${guid}" />
          <parameter name="time" layout="${longdate}" />
          <parameter name="message" layout="${message}"/>
          <parameter name="sender" layout="${event-context:sender}"/>
  </target>
</targets>

I would like to be able to get it on the service like this:

string sender = logEvent.Properties["sender"] as string;


I hope it is more clear now.
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: ILogReceiverServer custom parameters

smlyttle
Did you ever find a solution to maintaining the names of the parameters?
Reply | Threaded
Open this post in threaded view
|

Re: ILogReceiverServer custom parameters

smlyttle
Fleed: Would you mind sending me sample code for your Client and Service?  I am having an issue with customer parameters and I would greatly appreciate it.

Thanks.