Question about using log4net with chainsaw

Hi
I'm using log4net and would like display log messages with apache
chainsaw.
For this reason I've added an UDPAppender. I got it to work but there
still exists a problem.
All messages are displayed in chainsaw in the default table.
Because I have a lot of instances of my App running, I want to show the
log messages of each instance in its own table in apache chainsaw.
I read in the Tutorial that there is a property that is responsible in
which table the log message appears in chainsaw.
The name of this property is "application";
How can I add this property to my log-messages in log4net?
I'd like to do that programmatically.
I appreciate your help.
Best regards,
Philipp Uhlmann

Database logging problems

Marc McGinley <marc <at> dreamspace.net>
2008-09-02 09:43:26 GMT

Hi,

I've been playing with
log4net and writing to file seems to work okay =20 but when I try logging to a
database nothing happens...

To explain a little more...
I'm running a trace on the database and I =20 can see that it's trying to
commit a transaction but it's not =20 resulting in any writes. I was playing
with this for hours yesterday, =20 turned on the machine this morning and there
were some rows in the =20 database. I've played around this morning (should
have submitted at =20 least 30 logs from the same page (that worked last
night)) and only =20 one of them has come through.

Is there some sort of
buffer? The writing to db seems to be a little =20 erratic (I've no way to
predict how often it writes) is there anything =20 I can do to sort this out?

Re: Database logging problems

I've been playing with
log4net and writing to file seems to work okay =20 but when I try logging to a
database nothing happens...

To explain a little more...
I'm running a trace on the database and I =20 can see that it's trying to
commit a transaction but it's not =20 resulting in any writes. I was playing
with this for hours yesterday, =20 turned on the machine this morning and there
were some rows in the =20 database. I've played around this morning (should
have submitted at =20 least 30 logs from the same page (that worked last
night)) and only =20 one of them has come through.

Is there some sort of
buffer? The writing to db seems to be a little =20 erratic (I've no way to
predict how often it writes) is there anything =20 I can do to sort this out?

I've been playing with log4net and writing to file seems to work
okay =20 but when I try logging to a database nothing happens...

To explain a little more... I'm running a trace on the database
and I =20 can see that it's trying to commit a transaction but it's not =20
resulting in any writes. I was playing with this for hours yesterday, =20
turned on the machine this morning and there were some rows in the =20
database. I've played around this morning (should have submitted at =20 least
30 logs from the same page (that worked last night)) and only =20 one of them
has come through.

Is there some sort of buffer? The writing to db seems to be a
little =20 erratic (I've no way to predict how often it writes) is there
anything =20 I can do to sort this out?

Additivity flag question

Hello,
I'd like to control the Additivity flag programmatically. I know that it
can be changed from the config file but want to change it within a
program. The flag is a parameter of the Logger class but not on the ILog
interface. If possible, what's the preferred method of doing this?
Thanks in advance,
Mark

RE: Additivity flag question

Georg Jansen <Georg.Jansen <at> Faktnet.com>
2008-09-02 11:43:34 GMT

Mark,
I believe you can do something like:
log4net.ILog log = log4net.LogManager.GetLogger("LoggerName");
log4net.Repository.Hierarchy.Logger mylogger = log.Logger as
log4net.Repository.Hierarchy.Logger;
mylogger.Additivity = false;
Best regards
Georg
www.l4ndash.com - log4net Dashboard, Log analysis and monitoring made easy!
-----Original Message-----
From: Mark Willis [mailto:mark.willis <at> automation-consultants.com]
Sent: 2. september 2008 13:04
To: log4net-user <at> logging.apache.org
Subject: Additivity flag question
Hello,
I'd like to control the Additivity flag programmatically. I know that it
can be changed from the config file but want to change it within a
program. The flag is a parameter of the Logger class but not on the ILog
interface. If possible, what's the preferred method of doing this?
Thanks in advance,
Mark

GAC vs. XmlHierarchyConfigurator Problem

<CLaco <at> SummitRacing.com>
2008-09-10 16:44:34 GMT

I've found a few posts on Google about this issue, but none seem to be the exact problem I'm having.
When I started adding log4net to some of my projects, I just added a reference to the dll, which was then copied to the output directory.

I added this following code to my AssemblyInfo file, setup the app.config and everything worked like a champ.

<Assembly: log4net.Config.XmlConfigurator(Watch:=True)>

I then installed log4net into the GAC on the servers and then on my machine and removed all copies from bin. Everything compiles, and even runs fine, but nothing is logged.

After turning on log4net internal debug logging,. I see the text below in the log4net trace.

Clearly, It's loading log4net from the GAC to start with, but then stalls out during the XmlHierarchyConfigurator part of the process.

Any ideas?

Of course, if I place a copy in bin, it works; thus defeating the purpose of installing it into the GAC.

I've found a few posts on Google about this issue,
but none seem to be the exact problem I'm having. When I started adding log4net to some of my projects, I just added a
reference to the dll, which was then copied to the output
directory.

I added this following code to my AssemblyInfo
file, setup the app.config and everything worked like a champ.

<Assembly: log4net.Config.XmlConfigurator(Watch:=True)>

I then installed log4net into the GAC on the
servers and then on my machine and removed all copies from bin. Everything
compiles, and even runs fine, but nothing is logged.

After turning on log4net internal debug logging,. I
see the text below in the log4net trace.

Clearly, It's loading log4net from the GAC to start
with, but then stalls out during the XmlHierarchyConfigurator part of the
process.

Any ideas?

Of course, if I place a copy in bin, it works; thus
defeating the purpose of installing it into the GAC.