Method 3 has been actually used in projects. Maybe my needs are slightly different from yours. The writing frequency of my logs generally does not exceed 10 entries/second, but the log files need to be saved on a daily basis and old files are deleted regularly (save logs of the past 7 days, etc.), so regular closing is a must~
My question is, under Windows 2008, if the log handle is open, it cannot be copied and deleted.
This is very annoying. I hope I can view the log handle easily at any time. I don’t know how the first type of opening and closing frequency is very high, and how it affects the program and hard disk IO performance.
I haven’t used the log4cpp cplus log system yet, I don’t know what their design is!
Method 3 has been actually used in projects. Maybe my needs are slightly different from yours. The writing frequency of my logs generally does not exceed 10 entries/second, but the log files need to be saved on a daily basis and old files are deleted regularly (save logs of the past 7 days, etc.), so regular closing is a must~
Method 2, try opening the handle again when an error occurs
My question is, under Windows 2008, if the log handle is open, it cannot be copied and deleted.
This is very annoying. I hope I can view the log handle easily at any time. I don’t know how the first type of opening and closing frequency is very high, and how it affects the program and hard disk IO performance.
I haven’t used the log4cpp cplus log system yet, I don’t know what their design is!