title: FileHandler - java.logging.util no carriage return
body: <p>I'm trying to print log information on file using java.logging.util. This solution is working, but the information from the log doesn't show with the carriage return.
  My code:</p>
  <p>Main</p>
  <pre><code>   String url =&quot;opc.tcp://DEV85:53530/OPCUA/SimulationServer&quot;;
     MyFormatter formatter=new MyFormatter();
     fh = new FileHandler(&quot;C:/tmp/MyLogFile.log&quot;,true);
     logger.addHandler(fh);
     fh.setFormatter(formatter); 
     
     doSomething else()
     
     EndpointDescription[] endpoints = myClient.discoverEndpoints(url);   
  
  
     for(EndpointDescription e: endpoints) {
          //System.out.println(e);
          
          logger.info(e.toString());
      }
  </code></pre>
  <p>Formatter Class</p>
  <pre><code>public class MyFormatter extends Formatter {
      
      // Create a DateFormat to format the logger timestamp.
      private static final DateFormat df = new SimpleDateFormat(&quot;dd/MM/yyyy hh:mm:ss.SSS&quot;);
  
      @Override
      public String format(LogRecord record) {
          StringBuilder builder = new StringBuilder(1000);
          builder.append(df.format(new Date(record.getMillis()))).append(&quot; - &quot;);
          builder.append(&quot;[&quot;).append(record.getSourceClassName()).append(&quot;.&quot;);
          builder.append(record.getSourceMethodName()).append(&quot;] - &quot;);
          builder.append(&quot;[&quot;).append(record.getLevel()).append(&quot;] - &quot;);
          builder.append(formatMessage(record));
          builder.append(System.getProperty(&quot;line.separator&quot;, &quot;\r\n&quot;));
          //builder.append(&quot;\n&quot;);
          return builder.toString();
      }
  
  }
  </code></pre>
  <p>The output is just on a line. I've found out online some solution, but  nothing it's working for me.</p>