如何记录格式化的消息,对象数组,异常?
记录填充的消息和异常的堆栈跟踪的正确方法是什么?
logger.error(
"\ncontext info one two three: {} {} {}\n",
new Object[] {"1", "2", "3"},
new Exception("something went wrong"));
我想生成一个类似于以下内容的输出:
context info one two three: 1 2 3
java.lang.Exception: something went wrong
stacktrace 0
stacktrace 1
stacktrace ...
我的SLF4J版本是1.6.1。