---
title: "java 调试技巧: Stacktrace Console "
author: "zwhc"
date: "2011-10-10T11:28:42Z"
tags: ["Java", "console", "stacktrace", "调试"]
categories: ["编程语言"]
slug: "java-stacktrace-console"
draft: false
lastmod: "2011-10-10T11:32:43Z"
id: 1188488
url: "https://zwhc.iteye.com/blog/1188488"
---

java 调试技巧: Stacktrace Console 

利用 console 的  hyperlink 功能，我们可以如下配置 log4j：
log4j.appender.A1.layout.ConversionPattern =%d{HH:mm:ss,SSS}  %-5p (%c.java:%L) - %m%n

这样，输出的日志里，就有超链（hyperlink）了，点击，即可跳转到相应的代码上。

输出的日志如下：
02:45:08,304  DEBUG (<org.springframework.jms.core.JmsTemplate.java:428>) - Executing callback on JMS Session 

点击( <org.springframework.jms.core.JmsTemplate.java:428> ) 即可跳转到源码。
------------------------------
参考：

Stacktrace Console 
<http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fconsole%2Fref-stacktrace_console.htm>


The Stacktrace Console displays a Java stacktrace in a nicely formatted manner, providing hyperlink support to quickly jump to source code locations. 

Open Link 	Allows you to follow the hyperlink which was right-clicked on in the current stacktrace.

------------------------------
Open Link
<http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fconsole%2Fref-stacktrace_console.htm>
Select the Open Link command to follow a detected hyperlink in the Stacktrace Console or the CVS Console.