log4net

Should I use log4net directly in my domain model objects?

I'm wondering if it's bad practice to use log4net directly on my domain object... I'll be using ELMAH for my exceptions on the ASP.NET MVC application side, but for some informational purposes I'd like to log some data about the domain model itself. Given the following domain object: public class Buyer { private int _ID; pub...

Put Debug Info and Error Info into two different log file (Log4net)

I am using NHibernate and log4net. This is a snapshot of my error log file, using a release version of my software: INFO 2009-04-28 03:07:06 - processing cascade NHibernate.Engine.CascadingAction+SaveUpdateCascadingAction for: bpojob.Generated.BusinessObjects.Job INFO 2009-04-28 03:07:06 - cascade NHibernate.Engine.CascadingAction+SaveU...

Using log4net and where to implement it and usign with elmah?

Hi there, does anyone have experience with log4net, i have been looking at elmah which is great. But i wanted a little bit more control i.e. to use logging not only in asp.net but also in wpf. Anway i decided to take a look at log4net. I have 2 clients, (wpf and asp.net) that both share business logic. Should i be raising events in ...

Turn off Debug Logging during Release in Log4net

When I compiled my application in release mode, I found that the Log4Net still logs debug information; any idea how to fix this? This is my App.Config file: <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/> </configSections> <log4net> <root> ...

How-to create a simple example Console application for developing separate classes for test driven development?

Hi all! My intend is to create a simple easily debuggable console application which will be the template ( or starting point ) for test driven developing single classes in C#. The purpose is to have a simple folder where this console app will reside and just copy paste the folder open the new project and start writing the new class. As s...

.NET Logging Class with Fluent Configuration

Is there a .NET logging class that does not rely on XML configuration files? I thought is was possible with log4net but can't find any info. ...

What .NET instrumenting framework would you recommend and why?

I only have experience with log4net however that does not mean that there are not better fish in the sea. I don't have time to go fishing but I do I have 60 seconds to post to SO. So what all has everyone used and their experiences with it? I understand this is subjective, but please provide concrete reasons of why you have your opin...

A good example of custom log4net appender outputting text directly to a asp.net control ( custom control , Label , etc) ?!

I do have db appender and know how to get the output to a custom "logging" page ... The idea is to have a quick and dirty switch to write for example to the Response object ... ...

Encrypt the connectionString used by the log4ent AdoNetAppender

I'd like to encrypt the connection string used by the log4net AdoNetAppender. Can this be done without encrypting the entire appender? Dion Olsthoorn blogged about setting the connection string in code, but I'd prefer to do it in a config file that is dedicated to logging as it will be using a different database to the rest of the appl...

Log to XML column using log4net

Is it possible to log to an XML column in SQL Server using the AdoNetAppender in log4net? I know that I can treat the column as a string and log that way through: <parameter> <parameterName value="@details" /> <dbType value="String" /> <size value="4000" /> <layout type="log4net.Layout.PatternLayout"> <conversionPa...

Log4net - dynamically switch appender between AdoNetAppender and RollingFileAppender

Hi, I am using AdoNetAppender (SQL server) in my asp.net application and would like use to RollingFileAppender incase of any connection issue with SQL. Is there any way to configure to use RollingFileAppender only when there is an issue with AdoNetAppender? Thanks por ...

log4net when to log?

Hi there, DOes anyone have any good information with regards to when to log, I was thinking of logging an INFO type when i enter each c# method and recording another info when exiting.. Is this considered good or bad? Will i see a performance hit? If i do record an INFO when i enter a method, the idea would be to record the method nam...

Exception if Log4net isn't configured correctly

By design Log4net only outputs a message to the console if it can't be configured correctly (http://log4net.sourceforge.net/release/1.2.0.30316/doc/manual/faq.html#reliable). Logging is a critical part of my application, so want to know if Log4net was configured correctly. I've not been able to find any way to get the info from Log4net,...

log4net pure code configuration with filter in c#

I am trying to configure Log4Net purely by code. But, when I did with a minimal configuration, I was flooded by logging messages from NHibernate and the fluent interface. So, what I am trying to do is simple. Tell Log4Net to show me onyl log messages of my single class. I toyed around a little bit, but can't figure it out... Can anyone...

log4net: Logging two messages in one row in the database?

I'm trying to log the input and output of a particular method to the database. I'd like to have this information in separate columns. I've investigated the PatternLayout and it seems that it only caters for a single %message parameter, meaning that if you do: log.Debug("This is a message"); then log4net sees "This is a message" as t...

Log4Net incubating?

What does this mean "incubating"? well i know what the word means but why are the file named as "incubating-log4net-1.2.10.zip" Apache? Is log4net still under development as the last release was 2006? ...

Usage of log4net in .net petshop 4

I have a question regarding log4net usage for logging information in .net petshop 4 application.How do I use it to log informaton related to size of the message and time at which logging occurs.Please help !I have tried opening .net petshop using visual c# express edition 2008 and visual web developer 2008 but the solution items are unav...

Postsharp and log4net and log4postsharp

I stumbled upon log4postsharp site which is a great tool that uses postsharp for injecting log4net statements into your code at compile time. The current version of log4postsharp uses Postsharp 1.0 which has some limitations. Does anyone know if there is somewhere a compiled version of log4postsharp that uses Postsharp 1.5 available? ...

What is the best practice for debug statements which have string operations in them?

I often find myself adding either concatonated strings or using a string formatter in my debug statements in log4net and log4j should I surround these debug statements with an "if debug" block to stop myself from wasting resources by processing these parameters even though the debug statement will not be printed out? I would assume that...

Use the ASP.NET request user for Log4net log entries

My ASP.NET site is using Integrated Authentication with impersonation turned off. I have added a "%username" to my "conversionPattern" in the web.config to add the user name to each logging entry. However this will use the application pool identity's user name, and not the current visiting user's name. Any ideas on how best to do this?...