views:

34

answers:

1

I'd like to use log4net's RollingAppender to write to isolated storage, but I can't figure out how to configure log4net to do so. To be clear, I'm trying to do this in an installed WPF application so I don't have some of the issues that some of the Silverlight users have already posted.

I thought my best chance was to dynamically set the file path as described in this answer, http://stackoverflow.com/questions/571876/best-way-to-dynamically-set-an-appender-file-path, but of course you don't have access to the isolated storage's file path.

Can anyone confirm whether it's possible to setup a log4net RollingAppender to use the isolated storage, and if so how?

A: 

I don't know if this will help you, but I posted an idea for creating a new Target for NLog that could write to isolated storage. I have not tested it, but it seems pretty straightforward.

Here is the link to the question where I posted my suggestion as an answer:

http://stackoverflow.com/questions/4025471/logging-with-nlog-into-an-isolated-storage

Assuming it works, it would probably be pretty easy to create something similar in log4net. Of course, it would not have the same capabilities as the RollingAppender, so it might not be of much use to you, even if it does work.

wageoghe
Thanks Wageoghe. I'm coming to the realisation I will need to write my own output handler to write to isolated storage. I'll take your idea and see if I can get it to work in log4net.
Chris Spicer