how to archive the rolling log into a different floder in ent library v4.1
I want to know what is the simplest way to archive my old logs into a folder but not in the main logging file directory. what the hell do I mean?
for example: I logging into a file called "开发者_StackOverflow中文版Operation_Log.txt" and I every day\10mb the log is "rolled" and a new Operation_Log.txt" is created and the old file become "$CurrentTime_Operation_Log.txt", I want the "rolled" file to be created in a different directory how can this be done?
Build an application that can do it and have it reside on the server. Have it run once per day as a scheduled task.
See documentation on the System.IO.File Class for Reading/Writing the files.
Now.ToString will give you the current time in string format in .Net.
Move to Ent Lib 5.0 - in the logging application block there is a new configuration to enable to the saving on only a number of old logs files
精彩评论