Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java logger errorAdd Answer

public class MyClass{

  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
    }
    ....
  }

  ....
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #logger #errorAdd #Answer
ADD COMMENT
Topic
Name
3+2 =