Im using Apache Tomcat 7. When I'm running Tomcat with security manager and with the -Djava.security.debug
parameter I'm getting so much of text in console. I can't read the text in console. So I need the console log into some file. How can I achieve this?
Asked
Active
Viewed 3.0k times
6

StackzOfZtuff
- 2,534
- 1
- 28
- 25

Hariprasath
- 828
- 4
- 15
- 41
-
Take a look in `C:\Program Files\Apache Software Foundation\Apache Tomcat 7....\logs` - you may find `localhost...log`. – OldCurmudgeon Oct 14 '14 at 11:47
3 Answers
7
Remove ConsoleHandler
from logging configuration. In conf/logging.properties
:
Change this -
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
To this -
.handlers = 1catalina.org.apache.juli.FileHandler
The logs will be in the file catalina.log
.
If you want to disable console logging for selected applications, you can set swallowOutput
in true in the <Context>
element.
...
<Context path="..." swallowOutput="true">
...
-
1it doesn't affected to me in apache-tomcat-7.0.5\logs\catalina.2014-10-14.log – Hariprasath Oct 14 '14 at 11:58
3
Using catalina.bat
run can start the tomcat in the current console instead of a new console , so you can redirect all the standard error and standard output stream of this command to a file using
catalina.bat run > tomcat.log

Ankur Singhal
- 26,012
- 16
- 82
- 116
-
-
-
-
@Hariprasath it does not struck, it will not print anything on console now, everything will be printed to a `tomcat.log` file, seaarch for that file. – Ankur Singhal Oct 14 '14 at 12:12
-
yes thankyou. It logged in tomcat.log, but i need to run tomcat with some parameters like startup.bat -security. How can i. – Hariprasath Oct 14 '14 at 12:16
1
for ubuntu user, use following command:
- cd /opt/apache-tomcat-8.0.36/bin$
- ./catalina.sh run > tomcat.log
you will get the logs. Once you run this command you will get all the log files under /opt/apache-tomcat-8.0.36/logs folder..

alok
- 2,718
- 21
- 17