Tomcatのエラーログをeclipseのコンソールに出力する
Seasar2を使ったWebアプリケーションを作っていて、思うように動かない現象に何度か遭遇しました。原因はサーバ起動時にSeasar2の初期化に失敗しているだけなのですが、それがeclipseのコンソールに出ないので気がつくまでに時間がかかるというマヌケな状態に(^^;
で、server.xmlを編集すればeclipseのコンソールに出力できることが分かったので、一応メモしておきます。たぶん、常識なんだと思いますが。
<!-- Logger shared by all Contexts related to this virtual host. By default (when using FileLogger), log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory.--> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true"/> <!-- 以下の設定を追加する --> <Logger className="org.apache.catalina.logger.SystemErrLogger" timestamp="true"/>
2006/09/21追記:Tomcatのバージョンは、5.0.28で試しています。