This is more complex than it needs to be, because you want to keep the existing file and start a new one with a different name.
As a result, the
fileName
you are using may not be the name of the file you are saving to, and you have to assume that it isn't because you don't know if you can pass a new name "back up the chain" - the code may be:
Log(@"C:\Logs\LogFile.txt", MyLogMessage);
Which mean it will be the same each time the Log method is called. This means that every time to try to log something, you must search for all files in the specified directory which match the file name given, and a have any number of "-1"s appended to them. You can then add your log entry to the last one.
For example:
Original File : LogFile.txt
It filled up, so you create LogFile-1.txt and have to fill that.
It fills up, so you create LogFile-1-1.txt and start filling that.
And so on.
If you must it this way then you have a small and annoying job on your hands!
Instead, I would work like this:
File the base file until it is full (100mb).
Rename base file with a prefix for the current date and time, in YYYYMMDDHHmmss format.
Create a new log file, and work from that.
It is easier to find the order the files should go in, and easier to find a specific entry if you know when it was logged. And a whole lot easier to log an entry!