title: Create log file for Java program
body: <p>I have a java program for which I created batch file to schedule it after some period to run.
  I want to generate log file for that program whenever it get loaded,
  that log file must contain date time and error if any thrown.</p>
  
  <p>How to create log file for Java program?</p>