title: limiting size of text file and creating a new one dynamically in java
body: <p>I am writing some logs to a TXT file using file writer and I want to limit the size of the txt file to some value.<br>
  Once the limit is reached I want to create a new file dynamically.<br>
  Is there a way to do it in java?</p>
  
  <p>Java code would be appreciated.</p>