File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Thread priority issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread priority issues" Watch "Thread priority issues" New topic

Thread priority issues

Swapna Matetu

Joined: Dec 03, 2004
Posts: 3

I have a problem with threads. We have a web application that has its own logging object(for logging onto a log file or to console).And if I start another threads (for eg: to constantly write incoming messages onto a file etc), for some reason, the logger is not logging messages anymore either on to the console or to the log file, but the code is getting executed.We have tomcat and weblogic running on different environments for the web application.

What could be the possible reasons for such issues. Iam not sure if the new threads are getting more priority than the original application process threads. Can anyone give any ideas for resolving this issue?

Ranch Hand

Joined: Dec 05, 2004
Posts: 48
You have not specified what kind of logging utility u r using. Is that Log4J?
Logging utilities will be designed in such a way to leverage performance benefits in web applciations. When you actually log a message using log utility's method, the method jsut takes the message and hand that over to it's internal threads and your method call(thread of execution) returns simply from that method without getting involved in doing the IO.

Your doubt may be correct : Application threads are having higher priority over Logging threads. More over just cross check your configuration settings of Logging. Logging utilities can filter log messages based on the severity and the settings defined in configuration.

Thanks,<br />Bhanu<br />SCEA Step-I<br />SCBCD for J2EE 1.3<br />SCJP1.4
Swapna Matetu

Joined: Dec 03, 2004
Posts: 3
we are using Log4j. I checked to make sure that the new threads do not have any synchronized methods. I will check log cofiguration too.If i comment out the code that starts new threads, the application is functioning normally. But starting new threads is imperative.

Is there a way to debug such thread issues?

I agree. Here's the link:
subject: Thread priority issues
It's not a secret anymore!