how to print an exception using logger?

前端 未结 4 2143
无人共我
无人共我 2021-02-18 15:15

I have a situation in which I want to print all the exception caught in catch block using logger.

 try {
        File file = new File(\"C:\\\\className\").mkdir(         


        
4条回答
  •  你的背包
    2021-02-18 15:43

    Use: LOGGER.log(Level.INFO, "Got an exception.", e);
    or LOGGER.info("Got an exception. " + e.getMessage());

提交回复
热议问题