Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

Stop tomcat from throwing exceptions

hi experts,

When I start tomcat, i can see many exceptions being printed on the console. Instead of displaying on screen, i want to log them in a log file.

Thanks,
0
kumvjuec
Asked:
kumvjuec
  • 3
  • 2
  • 2
1 Solution
 
Ryan ChongCommented:
Try check the <Logger> tag in server.xml file of tomcat.

at:

<Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
              timestamp="true"/>

and edit the directory there..

More info:
Changing the location of Tomcat log files
http:Q_21122096.html

Logging in Tomcat
http:Q_20269918.html
0
 
Ryan ChongCommented:
the server.xml file is usually located at:

<Tomcat Home>\conf
0
 
kumvjuecAuthor Commented:
I have looked at it. But still, the exceptions are still there. I am startting Tomcat from commandline and exceptions print there on console. I watn to prevent them.

Thanks,
0
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
deleteguyCommented:
hey

what are the exceptions. is tomcat generating it.
are you deployign any application on it too?

you should reinstall tomcat to try this.
0
 
kumvjuecAuthor Commented:
Ohh, I tried this but still the exceptions print. I think my appplication must be throwing them.
The exceptions are java.net.NetException
0
 
deleteguyCommented:
see any code in the catch blocks where you may be printing them using printstacktrace etc. remove that code and make use of logger. one such logger is provided by apache itse;f. you see the javadoc s for it
btw, if this solves your prob then this was not the proper place for this q ;-)
0
 
kumvjuecAuthor Commented:
Ok, It never occured to me that the solution lies in modifying ythe code.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now