I would like to implement logging in my application, but would rather not use any outside frameworks like log4net.
So I would like to do something like DOS's echo to a file. What is the most effective way to do it?
Is there a way to log unhandled exceptions logged without using an outside framework?
C log() PrototypeThe log() function takes a single argument and returns a value of type float . [Mathematics] logex = log(x) [In C programming] It is defined in <math. h> header file. In order to find the log() of long double or float numbers, you can use the following prototype.
A log, in a computing context, is the automatically produced and time-stamped documentation of events relevant to a particular system. Virtually all software applications and systems produce log files.
public void Logger(string lines) { //Write the string to a file.append mode is enabled so that the log //lines get appended to test.txt than wiping content and writing the log using(System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt", true)) { file.WriteLine(lines); } }
For more information MSDN
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