title: How to write log file in c#?
body: <p>How would I write a log file in c#?</p>
  
  <p>Currently i have a timer with this statement which ticks every 20 secs:</p>
  
  <pre><code>File.WriteAllText(filePath+"log.txt", log);
  </code></pre>
  
  <p>For everything that i want logged i do this: </p>
  
  <pre><code>log += "stringToBeLogged";
  </code></pre>
  
  <p>As you can assume the string log just grows and grows as the program runs. (I don't even know if there is a maximum chars per string?)</p>
  
  <p>I assume that there must be better ways of doing this. i just thought that it would be heavy to write the whole file again and again for every time something is added to the log.</p>