Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create log file

 
Joyce Leung
Greenhorn
Posts: 4
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i just start learning java, the first step is how can i write a log file info txt file ?
any example for my reference?

thanks sir or madam.
 
Henry Wong
author
Marshal
Pie
Posts: 20835
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joyce Leung wrote:i just start learning java, the first step is how can i write a log file info txt file ?
any example for my reference?


Here is a reference to the Sun logging tutorial.There are a few examples in the tutorial.

http://download.oracle.com/javase/1.4.2/docs/guide/util/logging/overview.html


The most popular logging engine is log4J, which is another option you can use.

http://logging.apache.org/log4j/1.2/

Henry
 
Sunny Bhandari
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
log4j will give you more power.

But the default logger available with Java is sufficient if you are just starting off.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a whole lot of logging frameworks out there. Log4j is one of the most popular ones. I prefer the "successor" of log4j: slf4j with the logback implementation. Slf4j separates the api from the actual implementation and can be used in conjunction with log4j. Log4j, slf4j and logback are all made by Ceki Gülcü.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic