logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Green" <James.Gr...@occam-dm.com>
Subject RE: Using AdoNetAppender
Date Tue, 16 Jun 2009 08:39:40 GMT
Hi Ron,
 
I did actually spot this just after posting the code and it did remove
the connection error I was seeing.
 
However, we have got it logging the date values now, however the other
fields are @log_level etc ... are still null.
 
Any ideas?
 
Cheers,
 
James.

  _____  

From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: 15 June 2009 22:01
To: Log4NET User
Subject: Re: Using AdoNetAppender


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.Green@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.

scanned by MessageLabs [www.messagelabs.com]


Mime
View raw message