Can you pull the connectionString for a log4net AdoNetAppender from elsewhere in a web.config file?

前端 未结 5 1884
花落未央
花落未央 2020-12-05 03:53

I already have a db connection string in my web.config file. I scanned the log4net docs, but can\'t seem to find a way to use it within the log4net section of my web.config

5条回答
  •  感情败类
    2020-12-05 04:27

    It is possible to use a DB connection string specified in web.config without creating a new class, though you would need to use log4net build that hasn't been released yet. It can be downloaded from SVN repository http://svn.apache.org/viewvc/logging/log4net/trunk/

    Your config will look as follows:

    
        
    
    
    
        
        
        
          ...
    
    

    Please note that connectionType still needs to be specified.

提交回复
热议问题