开发者

How to write to Tomcat log files

开发者 https://www.devze.com 2022-12-22 18:29 出处:网络
What is the easiest way to print out something in a Tomcat Log file. I was under the impression that System.out.println() would print to one of the log files.

What is the easiest way to print out something in a Tomcat Log file.

I was under the impression that System.out.println() would print to one of the log files.

I just want to print out the value of a st开发者_如何学Pythonring, so the simplest solution would be best. If there is no simple/trivial solution I guess I will use Log4J

EDIT: I used Log4J as follows:

As a class variable I declared:

static Logger log = Logger.getLogger("myClass");

I then placed:

 log.warn("Upload directory: "+destDirectory);

However now I want to read the value of destDirectory, and cannot see it in any of the Tomcat logs?


http://tomcat.apache.org/tomcat-6.0-doc/logging.html

Seems to explain what your looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消