• Post Reply Bookmark Topic Watch Topic
  • New Topic

File logging  RSS feed

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i don't know if it is wise to ask such questions here but i need to know what a file Logging as i could see people are writing programs on it.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by AJ sisodia:
sorry i don't know if it is wise to ask such questions here but i need to know what a file Logging as i could see people are writing programs on it.


What do you mean by file logging? Logging meaningful debugging statements to a log file?
 
AJ sisodia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what a log file and in what respect it is used in Java?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the uRL below:

What is LOG4J
http://www.java-tips.org/content/view/1370/29/

What are the differences between Log4J and logging API of Sun
http://www.java-tips.org/content/view/1374/29/
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by AJ sisodia:
and what a log file and in what respect it is used in Java?


When you code your application, when something goes wrong, how do you verify what could went wrong? Like say you've a method for adding a record into the database, but the new record wasn't added, you would like to know what went wrong, and where exactly are those lines of codes that are giving you problems.

This could be achieve through System.out.println, but in a production environment, you may not have access to the console, hence you redirect all your debug statements to a log file, which you could have access to. Another reason is that logging to a console, you may not be able to see the debug statements if the application is heavily used. But with a log file, you could search for the statements offline.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!