simplest way to log to tomcat catalina.out

后端 未结 2 913
温柔的废话
温柔的废话 2021-01-13 00:22

What is the simplest way to write logs to tomcat/catalina.out? I have tried System.out.print() and System.err.print() is working fine.

2条回答
  •  攒了一身酷
    2021-01-13 00:35

    import java.util.logging.*
    
    Logger.getLogger (YourClass.class.getName()).log(Level.WARNING, e.getMessage(), e);
    Logger.getLogger (YourClass.class.getName()).log(Level.INFO, "hello world");
    

提交回复
热议问题