Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: (small) Registry Garbage Coliection Issue With EventLogAppender?
Prev Next
You are not authorized to post a reply.

Author Messages
Billy Barnum

09/23/2005 9:42 PM  

This is not a bug exactly . more like a garbage collection issue I notice
that has to do with EventLogAppender. And it's certainly a small issue, but
.

I notice that when I execute EventLogAppender with a security account that
doesn't have enough authority to set up its own EventSource in the EventLog,
log4net creates its own event sources in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application,
which is what you have to do if you want anything in the Source field for
your EventLog items. Very normal. A question and a comment about this,
though:

1. I notice that if the appdomain name or pgm name or whatever, is different
for every run of the program, a new registry key is created. This seems to
be the case when running a web site within Visual Studio. So I'm
accumulating quite a few registry entries. So my question is, "why not just
use a constant value each time so you don't keep adding registry keys
forever, or will production web sites in release mode have the same value
each time"? If production web sites also have different "names" each time
they start, I'll bet there are lot of registries out there accumulating a
lot of junk. Anyone know if this is the case?
2. The FAQ entry, "Why doesn't the EventLogAppender work?" talks to this
issue a bit, and mentions 2 methods for allowing your app to have write
authority and have its own 'Source' field. But there is a 3rd, registry-hack
method for those of you who didn't know (And I didn't until just now) and
don't want to create an EventLogInstaller, but just write to the Application
Log. See http://support.microsoft.com/default.aspx?scid=kb;en-us;329291 ,
and add <applicationName value="myEventSource" /> to your EventLogAppender
description in your config file. One thing the article doesn't mention,
though: after you create the key, you have to add a string value to it with
the name ' EventMessageFile' and an actual value of '
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\EventLogMessages.dll', or
current version of that assembly. Look at some of the other keys in the
vicinity for examples.

I found this last one out myself the hard way and post it to save other
newbies like me some time.

-BillyB

WILLIAM BARNUM
b.barnum@comcast.net



You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > (small) Registry Garbage Coliection Issue With EventLogAppender?



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement