You can do that by inheriting AdoNetAppender.
- 1) Create a class that inherits from AdoNetAppender.
- 2) Next create a ConnectionStringName property that will set the Log4Net ConnectionString property to a connection string that is retrieved by the .Net ConfigurationManager.
- 3) Create a ConnectionStringName entry in the AdoNetAppender section of your config file which maps to an existing connectionString in the connectionStrings section of your config file.
See the below "Ken Burkhardt" blog for details.
http://kenny-bu.blogspot.com/2011/03/using-connection-string-name-with.html