问题
Has anyone written an event log that uses Isolated Storage in Silverlight 3? Any suggestions on implementing one?
Specific questions:
- Should I keep a stream writer open, or should I open,write, and close for each entry?
- How should I remove items from the log atomically?
回答1:
I heard clog from codeplex is pretty good although it targets wcf, i read on codeproject about about a log4net approach that works for silverlight, although both of these log 2 wcf services, im sure with a bit of tweaking you can modify this to write to isolated storage
回答2:
Crypto Logger supports Silverlight apps and libraries and it can log to its UI console via TCP, to isolated storage and also to the Browser Console (like Firebug in FireFox) or the in-built one in IE8.
回答3:
From the MSDN article on IsolatedStorageSettings and IsolatedStorageFile
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
来源:https://stackoverflow.com/questions/1579260/silverlight-event-log-in-isolated-storage