469,950 Members | 2,304 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Initializing custom trace listeners in web.config

I've created a custom trace listener which I'd like to initialize in
the web.config file of my application. I noticed that I can use the
initializeData attribute to pass a string to the constructor of my
custom trace listener, but is there any way to pass multiple
parameters to the constructor through the web.config initialization?

For example, I have a custom trace listener that sends email
notification of errors. I'd like to configure it through the
web.config with a list of addresses to notify as well as an
originating address for the message. I found that I can do this by
passing a delimited string such as:

sy****@foo.com|b*********@foo.com;su*******@foo.co m

where the address before the pipe is the originating address and the
addresses after are the target recipients. I'd then split the string
and assign variablese accordingly. However, this isn't as clean as
I'd like. I'd much rather pass both sets of addresses as separate
parameters, but I can't seem to find a way to do that through the
web.config without using additional appSettings parameters which is
also not as clean as I'd like. Is it possible to initialize a trace
listener with multiple parameters through the web.config? Also, I'm
using the 1.1 framework for this specific application, but I'm curious
if there's a way to do this in any version.


Apr 5 '07 #1
0 1851

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Geopsaros | last post: by
3 posts views Thread by Jens Alenius | last post: by
2 posts views Thread by Richard | last post: by
2 posts views Thread by Jason L James | last post: by
4 posts views Thread by Jay | last post: by
6 posts views Thread by Zytan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.