logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florin Daneliuc <florin.danel...@iquestint.com>
Subject RE: Using log4net to write to remote windows event log
Date Tue, 23 Jun 2009 06:57:31 GMT
Thanks Karim.

In my case I have a number of systems distributed on different computers in a test environment
and I would like certain errors (that would cause my application to stop) to also go into
a central event log in order to be able to only inspect one event log. Emailing in my case
is not something that I would use.

The fact that Event Log is a windows technology it not an issue, this application is windows
only, log4net supports Event Log, even if not at it's full capabilities. In order to make
the Event Log appender be able to write to a remote Event Log you only need about 5 lines
of code changed. But of course, I'm not sure about the performance penalty and I don't know
why this capability was "postponed" in the appender (this might clarify this).

Also there is a appender that is able to write to remote sinks, RemoteSyslogAppender, which
is mostly Linux only, so using a remote sink is not something new. Windows 2008 seems to have
the ability to collect logs from other computers, so somehow they have thought about something
like this.

florin


________________________________
From: Karim Bourouba [mailto:karym6@hotmail.com]
Sent: Tuesday, June 23, 2009 12:25 AM
To: log4net-user@logging.apache.org
Subject: RE: Using log4net to write to remote windows event log

This isnt something I have ever needed to use log4net for, but there are two possibilities
for you: RemotingAppender and UDPAppender. Both of these appenders appear to be able to deliver
messages to remote apps, at least this is what the log4net page on config examples suggest:
http://logging.apache.org/log4net/release/config-examples.html

There is also a SMTPAppender that could also help you out.

However, I dont think there is anything ready made for you that will enter these events onto
another systems event log. If this is a Windows environment, then it isnt a great idea anyway.
If you think about it a bit, the event log is used for the system upon which the OS and other
applications are running. To me, it makes very little sense to log events from other systems
here.

Have you considered simply using the ADONetAppender to log events to a database somewhere?
This, to me at least, would be a better way of logging events - but then again I dont really
know what it is you are trying to do.




> From: florin.daneliuc@iquestint.com
> To: log4net-user@logging.apache.org
> Date: Mon, 22 Jun 2009 18:38:35 +0300
> Subject: Using log4net to write to remote windows event log
>
>
> Hello,
>
> I'm using log4net to log/trace an application and I would like to have cert= ain errors
ending up in the the event log from another computer. Is there a way to do this? (RemoteSyslogAppender?)
>
> It seems that I could do around the tree and use a ForwardingAppender which together
with a application acting as server on the remote computer would could write this to the event
log, but it looks a little to cumbersome.
>
> PS I was able to change log4net to write to a remote eventlog, but I would prefer to
use an "untainted" library.
>
> Thanks,
> florin

________________________________
View your Twitter and Flickr updates from one place - Learn more!<http://clk.atdmt.com/UKM/go/137984870/direct/01/>

Mime
View raw message