Solved

Stop tomcat from throwing exceptions

Posted on 2004-09-30
7
211 Views
Last Modified: 2010-03-17
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
Comment
Question by:kumvjuec
  • 3
  • 2
  • 2
7 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 12264811
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
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 12264821
the server.xml file is usually located at:

<Tomcat Home>\conf
0
 
LVL 3

Author Comment

by:kumvjuec
ID: 12274033
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Expert Comment

by:deleteguy
ID: 12310527
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
 
LVL 3

Author Comment

by:kumvjuec
ID: 12310838
Ohh, I tried this but still the exceptions print. I think my appplication must be throwing them.
The exceptions are java.net.NetException
0
 
LVL 1

Accepted Solution

by:
deleteguy earned 500 total points
ID: 12310872
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
 
LVL 3

Author Comment

by:kumvjuec
ID: 12316570
Ok, It never occured to me that the solution lies in modifying ythe code.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now