If you don't specify a ConnectionType AdoNetAppender defaults to using
OleDbConnection which has a different connection string format than the
more common SqlConnection. Are you sure you want to use OleDbConnection?

Why not write a simple ConsoleApplication to test your code and look at the 
configuration output log4net writes to Console.Out?

    class Program
    {
        private static AdoNetAppender _sqlDatabaseAppender = new 
AdoNetAppender();

        static void Main(string[] args)
        {
            LogLog.InternalDebugging = true;
            LogLog.EmitInternalMessages = true;

            ConfigureDatabaseAppender("...");

            ILog log = LogManager.GetLogger(typeof(Program));
            log.Debug("Hello World");

            Console.ReadLine();
        }

        public static void ConfigureDatabaseAppender(string connString)
        {
        // snip





________________________________
From: James Green <james.gr...@occam-dm.com>
To: Log4NET User <log4net-user@logging.apache.org>
Sent: Monday, June 15, 2009 12:04:16 PM
Subject: RE: Using AdoNetAppender


I think I'm going to have to try the config file method 
first.
 
I'm wrapping log4net and I don't want to cause every 
consuming component to require loads of config information in it just for 
logging purposes.
 
Everything else is a sinch to configure in code, save for 
this appender ... *sigh* ...
 
Cheers,
 
James.

Reply via email to