Search code examples
c#.netconnection-stringlog4netadonetappender

AdoNetAppender get connectionstring value from another file


I have multiple web services that currently logs their info\error messages using log4net into file. I want the logging now to be done in DB. I've read about AdoNetAppender and I can see that given some parameters such as command text and connection string it can be easily done.

BUT - my connection string is not in the same web.config as the log4net but is taken from config.ini in disk. Can I configure the AdoNetAppender so it'll extract the value of the connection string from there?

Thanks in advance


Solution

  • Eventually solved by this link:

    http://www.megustaulises.com/2012/12/set-log4net-connection-string-at-runtime.html