RE: Chainsaw and log4net

2004-11-17 Thread Nicko Cadell
Simon, You need to be careful about relying on the caller location information. The .NET runtime does not guarantee to make that information available. In release builds this is especially true as the JIT will inline method calls which effectively breaks the caller location info (stack trace). Th

RE: Chainsaw and log4net

2004-11-17 Thread Simon Wallis
Thanks Nicko, I'm half way there now. When I compile in Release mode and set LocationInfo to true for the XmlLayoutSchemaLog4j layout, log4net seems to populate ClassName and MethodName, but not Filename or LineNumber. When I compile in Debug mode then all four fields come through correctly. Do

RE: How to dynamically setup logging

2004-11-17 Thread Nicko Cadell
The following works for me. Is this roughly what you are after? public static void TestAddingAppender() { log4net.ILog log = log4net.LogManager.GetLogger("MyTestLogger"); log.Info("Not going to log"); ConfigureFileAppender("log.txt"); log.Info("But this is"); } public static void Conf

Re: DOMConfigurator.Configure()

2004-11-17 Thread Tom Willis
yeah no kidding. I was yanking my hair out over that one yesterday. :) That wouldn't be a log4net thing though would it? I thought that was more of an Nunit thing. On Wed, 17 Nov 2004 15:29:10 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > There are issues with using log4net with NU

Re: DOMConfigurator.Configure()

2004-11-17 Thread DWilliams
There are issues with using log4net with NUnit.  If you are using the NUnit GUI, you have to set the ApplicationBase in the project editor so that the config file can be found. Tom Willis <[EMAIL PROTECTED]> 11/17/2004 03:19 PM Please respond to "Log4NET User" To Log4NET User cc

Re: DOMConfigurator.Configure()

2004-11-17 Thread Tom Willis
Thanks Nicko I have the DomConfiguratorAtribute in my Assemblyinfo, yet it still doesn't work as expected. At least when run through NUnit. Based on the Caveat you just mentioned I wonder if perhaps Nunit is interfering. Though also, based on what you are saying, it seems the whole excercise of

RE: DOMConfigurator.Configure()

2004-11-17 Thread Nicko Cadell
Tom, You can use the log4net.Config.DOMConfiguratorAttribute to tell log4net where to load the configuration from. In the log4net 1.2 beta 8 download there is an example app that does this, have a look at: examples\net\1.0\Tutorials\ConsoleApp\cs\src\LoggingExample.cs The attribute can be spe

RE: can one use >1 appender and to have "fail-over" logging

2004-11-17 Thread Nicko Cadell
> Just for clarity, though: if a logger has two appenders and > one fails, the logger will continue logging to the > "remaining" appender? Yes the logger will continue to log to all appenders. How an appender chooses to handle its failure modes is up to it. An appender may recover from an erro

How to dynamically setup logging

2004-11-17 Thread Chastain, Roy
I have an application that may or may not want to log using the RollingFileAppender. I have many places that call GetLogger. It appears that if a call to GetLogger is done before the appended is added to the collection (Hierarchy->Root->AddAppender(the_new_appender) that the logger that is return

DOMConfigurator.Configure()

2004-11-17 Thread Tom Willis
I bet this question gets asked a lot. But I'm not finding anything in the archives. It's probably cuz I suck. Anyway, If there any way to set log4net up so that you do NOT have to call DOMConfigurator.Configure() before the logging goodness stats happening? Or is this a pipe dream? I'm using

RE: File logging issues with website

2004-11-17 Thread Patten, Stephen
Got it , thank you.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 11:13 AM To: Log4NET User Subject: RE: File logging issues with website   Yes, but remember to use double backslashes. C:\\foo\\bar.Logfile.log "Patten,

RE: File logging issues with website

2004-11-17 Thread DWilliams
Yes, but remember to use double backslashes. C:\\foo\\bar.Logfile.log "Patten, Stephen" <[EMAIL PROTECTED]> 11/17/2004 02:09 PM Please respond to "Log4NET User" To "Log4NET User" cc Subject RE: File logging issues with website

RE: File logging issues with website

2004-11-17 Thread Patten, Stephen
So I should use the full path as the name of the file? C:\foo\bar.Logfile.log   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 11:07 AM To: Log4NET User Subject: Re: File logging issues with website   You need to make sure that the log

Re: File logging issues with website

2004-11-17 Thread DWilliams
You need to make sure that the log file is in a location that the ASPNET user has rights to write to.  By the looks of this config you are attempting to write to the System32 directory - which ASPNET does not have any rights to. "Patten, Stephen" <[EMAIL PROTECTED]> 11/17/200

File logging issues with website

2004-11-17 Thread Patten, Stephen
I’ve used log4net in quite a few windows services and forms projects but not a .Net website, and am experiencing problems writing to a file with this appender. Can someone help point me in the right direction?   Thank you, Stephen   xml version="1.0" encoding="utf-8" ?>

RE: ERROR: No appender named [A] could be found

2004-11-17 Thread Torben Sorensen
Hello, I would suggest getting the latest code from the CVS repository and also grabbing the latest version of Nant, also from CVS. Both these projects seem to be behind in updating their respective packages ... -Original Message- From: Patrick [mailto:[EMAIL PROTECTED] Sent: We

RE: can one use >1 appender and to have "fail-over" logging

2004-11-17 Thread Marc Lewandowski
Nicko, Just for clarity, though: if a logger has two appenders and one fails, the logger will continue logging to the "remaining" appender? -Marc -Original Message- From: Nicko Cadell [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 2:39 PM To: Log4NET User Subject: RE: can on

RE: ERROR: No appender named [A] could be found

2004-11-17 Thread Neils . Christoffersen
In all the example documentation I've seen, the element of the config is defined after the definitions. I don't know why this would make a difference, but maybe try that and see if it makes any difference. I can't see anything obviously wrong with your code or config. -Original Message---

ERROR: No appender named [A] could be found

2004-11-17 Thread Patrick
I have downloaded Log4net 1.1.1 at http://prdownloads.sourceforge.net/log4net/log4net_1_1_1.zip?use_mirror=ovh I can't even get the TestApp example working (I have stripped it down and still no joy!). I note that the sample app does not have a config file in there. So here is what I did 1) Ext

RE: Easy Question

2004-11-17 Thread Dag Christensen
For performance, see the FAQ: http://logging.apache.org/log4net/release/manual/faq.html#HC-14456678 Dag From: Dru Sellers [mailto:[EMAIL PROTECTED] Sent: 17. november 2004 02:56 To: 'Log4NET User' Subject: Easy Question Why would you write If log.IsInfoEna

RE: Easy Question - Easy answer

2004-11-17 Thread Denis, Rich
Title: Message From the “Performance” section of the doc found at: doc/manual/introduction.html#performance   Performance One of the often-cited arguments against logging is its computational cost. This is a legitimate concern as even moderately sized applications can generate thousands

Easy Question

2004-11-17 Thread Dru Sellers
Title: Message Why would you write     If log.IsInfoEnabled Then log.Info("result=[" & result & "]")    over      log.Info("result=[" & result & "]")    Dru --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.794 / Virus Databas

RE: Logging Perf Hit

2004-11-17 Thread Dru Sellers
Title: Message So something like this for web apps?   Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)   Dim file As String = ConfigurationSettings.AppSettings("log4net")  log4net.Config.DOMConfigurator.Configure(New IO.FileInfo(file)) End Sub Then in your code you could