Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://wiki.apache.org/tomcat/FAQ/Logging" rel="nofollow">This page</a> gives a hint about how to do this, but it's a little cryptic. In short:</p> <ul> <li>Open the context.xml file for your tomcat config. For me, developing inside Eclipse, this is inside my Eclipse Workspace under</li> </ul> <blockquote> <p>\Workspace\Project\Servers\Server-name-config\config.xml</p> </blockquote> <p>There's also a global tomcat version under, which is worth a shot</p> <blockquote> <p>\tomcat\conf\context.xml</p> </blockquote> <ul> <li><p>Add swallowOutput="true" to the context as below</p> <pre><code>&lt;context swallowOutput="true"&gt; </code></pre></li> <li><p>(Optional I think) Set up your application logging. I've used LogBack in my application, but I'm not sure it's relevant as this goes through the internal Tomcat logging not your application logging</p></li> <li><p>In my tomcat.logging property I have the following log configuration lines. These lines define the log file that my System.out statements go to, though other people have said it goes to their catalina.out file</p> <pre><code>2localhost.org.apache.juli.FileHandler.level = FINE 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2localhost.org.apache.juli.FileHandler.prefix = localhost. </code></pre></li> <li><p>Now when you do a System.out.println it should appear in your localhost.log file as it does for me, though as I said some people have said it goes into catalina.log</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload