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, 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?

Community
  • 1
  • 1
Chris Spicer
  • 2,144
  • 1
  • 13
  • 22

1 Answers1

0

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:

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.

Community
  • 1
  • 1
wageoghe
  • 27,390
  • 13
  • 88
  • 116
  • 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 Oct 27 '10 at 08:22
  • Wageoghe's answer was helpful, and has not been bettered, so I'm happy to mark it as the right answer. – Chris Spicer Dec 02 '10 at 10:35