How do you write a full stack trace to the log?

后端 未结 6 1244
感情败类
感情败类 2021-02-18 18:07

I was catching an exception and trying to write the stack trace to the logs like this:

log.warn(e.getMessage());

But all it said was

         


        
6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-18 18:59

    Usually:

    log.warn("message", e);
    

    But it depends on your logging framework too.

提交回复
热议问题