Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread priority issues

 
Swapna Matetu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

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?

Thanks
Swapna
 
Bhanu
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Swapna Matetu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhanu,
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?

Thanks
Swapna.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic