aspose file tools*
The moose likes Java in General and the fly likes System crashes when logging is not enabled(Interview Question) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "System crashes when logging is not enabled(Interview Question)" Watch "System crashes when logging is not enabled(Interview Question)" New topic
Author

System crashes when logging is not enabled(Interview Question)

Vijaykumar Ramalingam
Greenhorn

Joined: Mar 03, 2011
Posts: 15
Guys,
I faced a google interview question that a system crashes when logging is not enabled and asked me the reasons for it.
I told them it is because it is a real time monitoring application system that runs on data from the logs.
But he said to me that the log statements are at the debug level and think of other reasons.
I couldnt think of a real solution for it.
Could you guys help me.
BTW:I am not sure of the question also like is (The system crashes when log is enabled/disabled?).

Thanks,
-Vijay
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

Possibly the logging statements have side effects. Something like this:
Although the example is a bit daft, it does modify behaviour if debugging is disabled - i will not be increased.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Rob Spoor wrote:Possibly the logging statements have side effects. Something like this:
Although the example is a bit daft, it does modify behaviour if debugging is disabled - i will not be increased.


Exactly!


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3018
    
  10
A more subtle cause might be that the code has concurrency bugs, and the log statements have the effect of slowing down some parts of the system, such that the concurrency bug does not manifest. But without the logging, the timing changes, and the bug manifests.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: System crashes when logging is not enabled(Interview Question)