java logger write error logs to the file

www‮uttual.‬ri.com
java logger write error logs to the file
private static Logger logger = Logger.getLogger(MyClass.class);

  public ReturnType myMethod(Param p, Param2 p2) {
    ....
    ....
    try {
      ..    
    } catch(MyException e) {
       logger.log("Exceptions happen!", e); //this will put all the details in log file configured earlier
    }
    ....
  }
Created Time:2017-09-26 17:15:54  Author:lautturi