File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 19655
    
  18

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: 3003
    
    9
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System crashes when logging is not enabled(Interview Question)
 
Similar Threads
Where should I keep my application's log files
Smart Inspect questions
java & System Properties Regarding..
Use of Never transactional attribute
Naming logger instances