I would agree that file based logging it core. I would probably not want my web application logging to a database, for sure not each log statement. If there was some buffering in between which batched the logs and then sent every once in a while to the DB that would seem better, to me at least. If I needed the logs in a database I would still probably write to a local file and then figure a way to get the files to a central location where they could be loaded into the database. Thanks, Nick To: dpsen...@gmail.com; log4net-user@logging.apache.org From: piers.willi...@gmail.com Subject: RE: unintended usage of the same configuration file Date: Sun, 11 Oct 2015 22:27:44 +0800
Dominic: I’m afraid I don’t agree with any of what you said. File based logging is a critical part of any instrumentation strategy – it’s way faster than logging to a (typically remote) database, and gives you somewhere to log the errors when the database is down. That’s assuming you have a database at all of course – not all web applications even have one (though I’d concede that’s rare). It’s true that web applications will typically have limited write access to local disks, and that’s entirely appropriate, but they always have some write permissions somewhere – even if it’s only to Temp. Establishing a location with write permissions for logs hardly entails ‘punching holes in permissions’. Finally, as best I can tell, none of this is relevant to the OP’s actual issue, which would be just the same whether he was logging to file or to database, because it’s a configuration issue. From: Dominik Psenner Sent: Sunday, 11 October 2015 2:35 PM To: Log4NET User Subject: Re: unintended usage of the same configuration file The concept behind how web applications work makes it hard to use file appenders. A web application should not access a filesystem directly and punching holes into permissions may not be advisable. If i had to work out a web app i would log to the database that the web application will require anyway. jmtc On 11 Oct 2015 4:26 a.m., "tasos" <tas...@gmail.com> wrote:Hello. I'm working on a .net application and i have used this guidance http://haacked.com/archive/2005/03/07/ConfiguringLog4NetForWebApplications.aspx/ There is a project on which i have added in the assemblyinfo.cs [assembly: log4net.Config.XmlConfigurator(ConfigFile = "foo1.config", Watch = true)] and in another one(different assembly) [assembly: log4net.Config.XmlConfigurator(ConfigFile = "foo2.config", Watch = true)] My configurations are like this http://pastebin.com/UpSpwMHH except the different output filenames (<param name="File" value="foofilename.log"/> ) The problem is that the assembly that uses foo1.config writes on the output file of the file that is configured in foo2.config. In each class i use log4net i declare as the guidance site(mentioned above) says:private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); Thank you in advance for your help!