Hello,
First let me thank your for your answer.
I read the FAQ and know that log4net is not a reliable system. My
question was more about the work that is needed to make it reliable.
I know what it implies to have this "reliability" but we simply do
not have any other choice. Our products have to be able to log certain entries
in a reliable way.
So I'll have to modify the Appenders, but my main question was:
how to get an error status back to the application from the log4net methods. If
log is not successful our software may need to decide to inform the user and
wait for him to solve the problem before the application can be further used. I
know this is not supported by log4net, but I saw an IErrorHandler
(http://logging.apache.org/log4net/release/sdk/log4net.Core.IErrorHandler.html)
and wondered if I could not start something with this.
Do you think it is feasible without too much work?
Thank you very much for your help,
Bruno Knittel
-----Ursprüngliche Nachricht-----
Von: Ron Grabowski [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 8. Januar 2008 18:48
An: Log4NET User
Betreff: Re: Error handling: how to be sure logs were correctly written ?
The FAQ states that log4net is not a reliable logging system:
http://logging.apache.org/log4net/release/faq.html
If you want something that is truly reliable my guess is that you'd have to
check the target to make sure information was received correctly. Maybe the
EventLog, syslog, or a message queue guarantee reliability. What happens when
the EventLog reaches its maximum size?
In the case of a FileAppender you might be able to turn on flushing after every
write then check to the length of the file (or open the file and seek to the
end) to make sure data has been written. CountingQuietTextWriter keeps track of
the number of bytes written to a file.
Verifying every message is written will definitely slow things down.
----- Original Message ----
From: Knittel Bruno <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, January 7, 2008 6:11:18 AM
Subject: Error handling: how to be sure logs were correctly written ?
Hello everyone,
We need a logging framework that runs on CF 2.0 (as log4net exists
for CF 1.0, it runs on CF 2.0) that can assure us that log was successfully
performed on every Appender.
In fact we want our application to be told by the logging framework
if log was successful.
Is this possible with the log4net framework?
If yes, what about the TCP/IP network appenders?
Thanks in advance for your help,
Bruno Knittel