You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Asher Kohn <er...@gmail.com> on 2010/07/06 13:33:58 UTC

EncryptedFileAppender

Hello,

There is post I pulled up from the mailing list archives dated: Mon, 02 May
2005 17:31:51 GMT (see link below) that says to create an EncryptedAppender
override the FileAppender. In fact the XML comments for the the method
protected virtual void SetQWForFiles(Stream fileStream) say "This method can
be overridden by sub classes that want to wrap the System.IO.Stream in some
way, for example to encrypt the output data using a
System.Security.Cryptography.CryptoStream."

However, when sub classing FileAppender I noticed the function
SetQWForFiles(Stream fileStream) never gets called. When looking at the
class using .NET Reflector I see that the method protected virtual void
OpenFile(string fileName, bool append) calls the method protected virtual
void SetQWForFiles(TextWriter writer) which does not easily wrapping the
stream in a CryptoStream.

I see how one could override the OpenFile method and create the CryptoStream
but I figured it would be easier than that. Am I missing something?

Thanks for a wonderful software library and running this mailing list.

-Asher


http://mail-archives.apache.org/mod_mbox/logging-log4net-user/200505.mbox/%3CDDEB64C8619AC64DBC074208B046611C363B47@kronos.neoworks.co.uk%3E