log4net

Why does log4net only log errors if my <root> level is INFO?

I obviously don't understand log4net. My root log level is configured as follows: <root> <level value="ERROR"/> <appender-ref ref="FileAppender" /> </root> My log initialization looks as follows: private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType...

how to insert into database from stored procedure in log4net?

I have to log thread context properties like this: string logFilePath = AppDomain.CurrentDomain.BaseDirectory + "log4netconfig.xml"; FileInfo finfo = new FileInfo(logFilePath); log4net.Config.XmlConfigurator.ConfigureAndWatch(finfo); ILog logger = LogManager.GetLogger("Exception.Logging"); log4ne...

Why do I get an empty eventlog when I do this with log4net?

I have class namespace LogToolsTest { public class Foo { private static readonly ILog logger = LogManager.GetLogger(typeof(Foo)); public Foo() { logger.Debug("Save this text"); logger.Info("Save this text"); logger.Warn("Save this text"); logger.Error("Sav...

Log4Net: Multiple loggers

Hi I have the following log4net configuration <log4net> <appender name="A1" type="log4net.Appender.RollingFileAppender"> <file type="log4net.Util.PatternString" value="C:\path1.log" /> </appender> <appender name="A2" type="log4net.Appender.RollingFileAppender"> <file type="log4net.Util.PatternString" value="C:\path2.log"...

How to get WinForms app to find a log4net config file when running from the IDE?

I'm using log4net with a VisualStudio WinForms app, and I need log4net to find its config file. (I must keep the config settings in a separate file.) It works if the config file is in the directory with the executable, but how do I get it there? For now I've added a post-build action: copy "$(ProjectDir)test.log4net.xml" "$(TargetDir)"...

Log4Postsharp (dead?) with postsharp 2.0 or drop for ELMAH ?

Hi there, Does anyone know if the latest build (march 2010 - i beleive called log4postsharp 2.0) is compatible with postsharp 2.0 community edition? I have used postsharp 1.5 together the log4postsharp in the past and was very pleased with the outcome. But log4postsharp seems to be dead, is this true? SHould i concentrate more on ELM...

Get an entry ID for log4net ADONetAppender

I am using log4net in a web app, and log all page errors to a SQL server. I was wondering if there was any way to retrieve the entry ID generated by it. I'm going off of the documentation found here http://logging.apache.org/log4net/release/config-examples.html I want to use this ID as a reference number I can show to a customer so tha...

Log4Net not working

I am working on .net framework 3.5 using C# in windows XP as administrator user, using log4net for .net framework 2.0 binary reference I had tried http://stackoverflow.com/questions/2620056/what-am-i-missing-with-log4net-no-log-file-created but it does`t work for me. i add the following into AssemblyInfo.cs [assembly: log4net.Config.X...

Are there any free offline eventlog explorer ?

Hi, I want to have some to tool to explore our eventlogs. There are few developers, so it would be nice if this tool is free. Log4net(btw : we use log4net to log in our applications) dashboard ([http://www.l4ndash.com/Default.aspx][1]) looks very nice, but it is paid and online and it's a problem. Has anyone know some interesting t...

Log4Net: How to get Logger?

I have been using Log4Net for several months, and I create a new Logger as a member variable for each class, like this: // Member variables private readonly ILog m_Logger = LogManager.GetLogger("MyClass"); Then I invoke the logger from each method in the class that logs, like this: // Initialize m_Logger.Info("MyClass.MyMethod() invo...

Reference to configurated project with log4net

Hi, I have a few applications and I want add to their reference to my class library MyLogger, which bases at log4net. In this library I have App.config file. So I want configuration file only in this one project/library. So, this is method in my applications public void TestMyLogger() { MyLogger myLogger=new MyLogger(); ...

Set log name in appender of log4net

I have class MyLogger, where I use log4net. How can I modify my appender to save log in specific logname (I want to set it by parameter logName). public void AddEntry(string source, string logName, string contextInfo, string message, EventLogEntryType eventType) { log4net.ILog Log = log4net.LogManager.GetLogger(sou...

Log4Net Database fun - connection strings!

This works on dev: <connectionString name="asdf" value="Data Source=.\;Initial Catalog=fmwebapp1;Integrated Security=True" /> <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> On live (a 64 bit VPS) this doesn't work: <connectionStr...

C# solutions : using one "Globals" project for external dll's?

(Sorry for might be a trivial question , I'm coming from Java & Maven , and still haven't wrapped my mind around C# dependencies ) I want to use log4net in all my projects. Since I don't want to add the dll to all the projects , I've created a "Globals" project , add a reference to log4net.dll in it , and referenced from all the other p...

Log4Net works on Dev machine, fails when deployed to shared host (using same db/connstring)

I have log4net configured and working fine on my local machine, however when I deploy to my host (godaddy) it fails silently. I am using the same database/config file on my dev machine, and on the host. My log4net reference is set to copy local, and the log4net.dll, .pdb, and .xml exist in the bin on the host. This is an asp.net mvc app....

Is there any considerations when using log4net in an application that uses NHibernate or Castle ActiveRecord?

Hi all, I used log4net in a sample application based on tutorial here. It works very well. But when I use same code and configuration in my main application, nothing works. My application is based on Castle ActiveRecord that itself is based on NHibernate. Both Castle ActiveRecord and NHibernate uses log4net internally. I'm suspicious ab...

Why is Log4Net ignoring my logName?

Okay so I have a WCF service writing to the Event Log. All is well except for one detail..it won't pay any attention to the logName attribute,..here's the config. <!--EventLog Appender--> <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" > <logName value="MyCustomLog"/> <applicationNam...

NotSupportedExceptions thrown everywhere when debugging in windows CE.

I am doing some work on a windows CE 6.0 application. The application loads a number of external assemblies dynamically using. Assembly assembly = Assembly.Load(path); These .dll files are outside of the solution, but there are classes in each of them that implement a common interface. Once the assemblies are loaded the application l...

log4net: deny other components except than a specific one from logging

Assume you are using some libraries like NHibernate or Castle ActiveRecord that use log4net internally. Your application uses log4net too. It's possible to configure all applications to save logs into file or any other output. But the problem is by enabling log4net for my own application, other programs save their log into the log file a...

log4net will not read from app.config

I have 2 projects configured identically for log4net. One project logs fine; however, the other does not log at all. The Logger in the project that is not logging returns IsFatalEnabled = false, IsErrorEnabled = false, IsWarnEnabled = false, IsInforEnabled = false and IsDebugEnabled = false. I've copied and pasted from one project to ...