This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes logging 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 » Beginning Java
Bookmark "logging" Watch "logging" New topic
Author

logging

Jayasri Alaparthi
Ranch Hand

Joined: Aug 14, 2006
Posts: 67
Hi friends,
what is the primary use of logging statements when we have System.out.println statement.
Thanks,
Bhargavi.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

A good logging system (like log4j for example) gives you a lot of flexibility and features that you don't get with simple System.out.println statements. For example, by configuring and using log4j properly you can very easily switch between different logging levels - you can for example choose to log only errors, or all debug messages. Also you can let log4j automatically add information to each log message such as a timestamp or a class and method name.

See the log4j documentation for more information.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: logging
 
Similar Threads
where to get info about commons logging, log4j and java.util.logging....
Class Instance being overwritten by new Instance
gonna see a man about a horse
Sub Level Logging
log4j apache common logging