EventLog configuration settings

Topics: Logging Application Block
Feb 26, 2011 at 2:26 PM

I'm a newbie to the Enterprise Library and haven't run across the answer to my question after a bit of searching so I thought I would ask.

Say you have 5 EXE projects and you want them all to share the same App.config file.  I want to use the Enterprise Library Configuration tool to configure the Logging Application Block for this one file and have it used by all projects.  I know this is feasible as I had it working, but with one glitch that I can't figure out.  The "Event Log Listener" configuration has a setting called "Source Name" that I want to match the name of the EXE that the message is being logged from.  Everything about my settings is the same except for this one field.

Is there some wildcard or token value I can set this field to so that the logger automatically takes on the name of the host EXE instead of using these settings?  I guess even if there is a programattic way to set it I could handle that too.  

Any advice is appreciated.



Feb 27, 2011 at 4:03 AM

There isn't any token value which you can use for this.  Workarounds for this would be to modify the configuration programmatically or create a custom event log listener. 


Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.