Hi,
Can anybody give me a hint on how to add a counter inside the logfile?
For example, if at first, the log file was created, it will write the current counter number, let say Log1. Everytime the application is open/launch the loop start and writes Log1, Log2, Log3, Log4 and so on for the same log filename if exist. If the file does not exist or let say a new log file was created the counter will reset to 1 and write this counter number to log file as well as the next number in the loop.
I used the below code snippet to open/create a log file.
Thanks for the quick reply.
Yes, you are right on that one.
But how can I put the last number if the application was closed? And if the user open the application after 1hour, how can I retrieved the last number and increment it and put it in the logfile?
Another thing, how can I determine if the logfile is new or not?
Thanks again and sorry for the confusion.
The Log1, Log2, Log3, etc. above is not a filename, it is inside the logfile.
If I have a logfile named Oct92009MyAppLog.log, inside this log are the number of the counter Log1, Log2, Log3, etc.