清除Java堆栈跟踪中的噪音 [英] Cleaning noise out of Java stack traces

查看:143
本文介绍了清除Java堆栈跟踪中的噪音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Java堆栈跟踪有很多我不关心的条目,显示通过代理和Spring反射方法的方法调用以及类似的东西。它可以使得很难从我的代码中挑选出堆栈跟踪的一部分。 Ruby on Rails包括一个堆栈跟踪清除器,您可以在其中指定从打印的堆栈跟踪中省略的堆栈跟踪模式列表 - 普遍使用Java的最佳方法是什么?



如果这个工作无处不在,最好在Eclipse jUnit转轮中。

解决方案

一个href =/ questions / tagged / eclipseclass =post-tagtitle =显示问题标记'eclipse' =tag> eclipse 有一个偏好堆栈跟踪过滤器模式(查看 java > junit 或在首选项中搜索 stacktrace )。您可以忽略包(通配符),类或方法。适用于直接测试呼叫(通过运行 junit 测试),而不是命令行运行,如 ant maven


My Java stack traces have a lot of entries that I don't care about, showing method invocation going through proxies and Spring reflection methods and stuff like that. It can make it pretty hard to pick out the part of the stack trace that's actually from my code. Ruby on Rails includes a "stack trace cleaner" where you can specify a list of stack trace patterns to omit from printed stack traces - what's the best way to do something like that, universally, for Java?

It'd be best if this worked everywhere, including in the Eclipse jUnit runner.

解决方案

has a preference Stack trace filter patterns (look at java > junit or search for stacktrace in the preferences). You can ignore packages (also with wildcards), classes or methods. Does work for direct Test calls (via Run as Test), not for commandline runs like ant or maven.

这篇关于清除Java堆栈跟踪中的噪音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆