I want to write a debug log file for my app.
I don't want to use NuGet because I have a log4net installation and it has caused problems.
I want to write a simple .log file so that I can add content through the process
I need something like:
System.IO.File.WriteAllText(path + ".log", "<some text>,");
// some lines of code here
System.IO.File.WriteAllText(path + ".log", "<more text>");
When I will open the log file I want to see: <some text>,<more text>
If you want to append (not rewrite) then put Append instead of Write:
...
System.IO.File.AppendAllText(path + ".log", "<more text>");
Do you mean to simply append? If so, you can simply use:
System.IO.File.WriteAllText(path + ".log", "<some text>,");
// some lines of code here
System.IO.File.AppendAllText(path + ".log", "<more text>");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With