Configuring log4net to Use Isolated Storage in WPF App
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 开发者_如何学Goof 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?
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.
精彩评论