title: How to write to log files in java?
body: <p>I have made a java application and wants to generate log files so whenever my client would encounter some problem, he can deliver me those log files so that I can correct my code accordingly.</p>
  
  <ol>
  <li><p>Kindly provide me a small sample program that writes a statement to a log file. Kindly mention the .class files you are using with their full import statements.</p></li>
  <li><p>The application is multi-threaded so Is it better to generate separate log files for each thread or not?</p></li>
  <li><p>Is it better to clear all previous log files before starting the program?</p></li>
  </ol>