Initializing custom trace listeners in web.config

Discussion in 'ASP .Net' started by boldtbanan@gmail.com, Apr 5, 2007.

  1. Guest

    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:

    |;

    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.

    Thanks.
    , Apr 5, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. martin

    Trace listeners

    martin, Dec 17, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    555
    martin
    Dec 17, 2003
  2. Martin

    Trace Listeners in a web app

    Martin, May 31, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    591
    Rick Strahl [MVP]
    May 31, 2004
  3. msnews.microsoft.com
    Replies:
    0
    Views:
    443
    msnews.microsoft.com
    Jan 5, 2007
  4. CSharpner
    Replies:
    0
    Views:
    1,019
    CSharpner
    Apr 9, 2007
  5. Matt Kruse
    Replies:
    2
    Views:
    172
Loading...

Share This Page