RE: Wrapping Log4Net

2009-07-20 Thread James Green
Hi, Despite what you have been told already I have wrapped log4net, if you do it right it is fine imho. I wrapped log4net since we need to consume it in scenarios where we absoloutely cannot have a plethora of config files kicking around all the time simply to enable some logging in the consuming

EventLog Fun Continued.

2009-06-19 Thread James Green
Hi All, I'm still at a total loss as to how to get log4net successfully writing to a custom event log, writing to the Application event log is working exactly as expected. I have started using the IEventIDLog extension in order to pass over event IDs to the log messages to see if this makes any

RE: Event Log Weirdness.

2009-06-19 Thread James Green
Hi Again, I seem to have some info to work on. Trying to log into my custom event log has generated this in the Application event log: The description for Event ID ( 0 ) in Source ( MyFirstApp ) cannot be found. The local computer may not have the necessary registry information or message DLL fi

RE: Event Log Weirdness.

2009-06-19 Thread James Green
Do you call ActivateOptions() when Threshold property is changed? Radovan Indeed I do ... public static void LogToEventLog(bool logToEventLog) { if (_eventLogAppender == null) return; if (logToEventLog) { _eventL

RE: Event Log Weirdness.

2009-06-19 Thread James Green
... James. -Original Message- From: James Green Sent: 19 June 2009 10:51 To: Log4NET User Subject: Event Log Weirdness. Hi All, I'm just looking into an odd issue. I have an EventLogAppender being configured in C#. If I set this up to append to the "Application"

Event Log Weirdness.

2009-06-19 Thread James Green
'm missing something in this setup process but I can't see anything in the Xml versions of configuration that suggest what to do ... Cheers, James Green Technical Lead - Core Systems Occam DM Ltd Tel: +44(0)1761234716

RE: Using AdoNetAppender

2009-06-17 Thread James Green
majority of the users configure log4net. I'll glady add your code configuration examples to AdoNetAppenderTest.cs if attach them to a JIRA ticket! _ From: James Green To: Log4NET User Sent: Tuesday, June 16, 2009 4:48:27 AM Subject: RE: Using AdoNetAppender Hi Again, Surely, thi

RE: Using AdoNetAppender

2009-06-16 Thread James Green
> bet that was a 'punching hands in the air' geek moment from hell Indeed ... I may even make a cup of tea to celebrate! :) Cheers, James.

RE: Using AdoNetAppender

2009-06-16 Thread James Green
Cracked it ... AdoNetAppenderParameter logLevel = new AdoNetAppenderParameter(); logLevel.ParameterName = "@log_level"; logLevel.Layout = new Layout2RawLayoutAdapter(new PatternLayout("%level")); logLevel.Size = 50; logLevel.DbType = Syst

RE: Using AdoNetAppender

2009-06-16 Thread James Green
Hi Again, Indeed, this isn't the most straight forward thing. >and failed - but this is possibly because of a few things outside the >responsibility of the log4net codebase. >There's nothing wrong working through a poroblem - to help improve the >situ - but just rubbishing it won't help anyon

RE: Using AdoNetAppender

2009-06-16 Thread James Green
ork by some very tallented and commited people. w:// On Tue, Jun 16, 2009 at 9:48 AM, James Green wrote: Hi Again, Surely, this is all pointing to a far bigger problem. That is an horrific piece of code!! Surely this is doable in pure C#? I'm am

RE: Using AdoNetAppender

2009-06-16 Thread James Green
/tests/src/Appender/Ad oNetAppenderTest.cs?view=co _ From: James Green To: Log4NET User 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

RE: Using AdoNetAppender

2009-06-16 Thread James Green
Console.ReadLine(); } public static void ConfigureDatabaseAppender(string connString) { // snip _ From: James Green To: Log4NET User Sent: Monday, June 15, 2009 12:04:16 PM Subject: RE: Using AdoNetAppender I think I'm going to have to try the c

RE: Using AdoNetAppender

2009-06-15 Thread James Green
if you need to - not sure why you'd need to tho? On Mon, Jun 15, 2009 at 4:31 PM, James Green wrote: I may have to try that. Currently it just fails with an "Oject reference not set to an instance of an object." Thanks, James.

RE: Using AdoNetAppender

2009-06-15 Thread James Green
ou already gotten AdoNetAppender to work from a app.config / web.config first? If not, I'd suggest getting that to work first. You may learn something in that process and it'll spark a realization of what you're missing in the from-code approach? -Original Message- From: Jam

Using AdoNetAppender

2009-06-15 Thread James Green
Hi All, I've spent about 4 hours today trying to get this working and have totally failed so far. I can't even really find much info on how to configure this purely in Code. In fact there is precious little I can find on the net in fact. Here is the code I'm using the set up the AdoNetAppend

RE: Redirecting Some Log Entries

2009-06-15 Thread James Green
doing the logging programmatically? I'm trying to do the same thing for unit testing custom layouts, appenders and loggers. Thanks Michael From: James Green [mailto:james.gr...@occam-dm.com] Sent: 15 June 2009 13:43 To: log4net-user@logging.apache.org Subject: Redirecting Some Log Entr

Redirecting Some Log Entries

2009-06-15 Thread James Green
Hi All, I'm just creating a wrapper for my use. The question I have is about redirecting or temporarily turning off appenders. Say I have two appenders added to the over all config. One is a simple file appender whilst the other is an Event log appender. Most of the time I just want things