【发布时间】:2016-11-25 11:22:58
【问题描述】:
我使用 wildfly,但 FILE 日志处理程序的输出有问题。它以完整格式打印堆栈跟踪错误的每一行。这是一个剪裁的例子:
12:13:11,238 ERROR [stderr] (default task-48) org.apache.shiro.authc.UnknownAccountException: Realm [XXX.account.library.security.shiro.ClientApplicationRealm@14896aa1] was unable to find account data for the submitted AuthenticationToken [org.apache.shiro.authc.UsernamePasswordToken - XXX, rememberMe=false].
12:13:11,238 ERROR [stderr] (default task-48) at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doSingleRealmAuthentication(ModularRealmAuthenticator.java:184)
12:13:11,238 ERROR [stderr] (default task-48) at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:267)
12:13:11,238 ERROR [stderr] (default task-48) at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:198)
12:13:11,238 ERROR [stderr] (default task-48) at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
...
我只想将"12:13:11,238 ERROR [stderr] (default task-48)" 的行放在开头一次,堆栈跟踪的每一方都以“at”开头,而不是将新的日志行解释为新的日志行。
我有一个额外的 SMTP 日志处理程序,也有同样的问题。因此,它会为堆栈跟踪的每一行发送一封电子邮件,而不是每个错误或异常发送一封电子邮件。
提前致谢。
【问题讨论】: