Results 1 to 1 of 1
- 07-22-2011, 12:31 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 8
- Rep Power
- 0
logging class outputs two text files when i only want one!!
public static void main(String[] args) {
Logger logger = Logger.getLogger("MyLog");
FileHandler fh;
try {
// This block configure the logger with handler and formatter
fh = new FileHandler("C:/newgui/MyLogFile.log");
logger.addHandler(fh);
//logger.setLevel(Level.ALL);
SimpleFormatter formatter = new SimpleFormatter();
fh.setFormatter(formatter);
// the following statement is used to log any messages
logger.info("");
} catch (SecurityException e) {
} catch (IOException e) {
}
logger.info("error log");
this code generates two output files called .mylogfile.log and myfile.log.lck f
.
How do i stop it outputting two each time i run it??
Similar Threads
-
inputs numbers then outputs how many time a particular number appears
By koji_kun in forum New To JavaReplies: 23Last Post: 12-22-2009, 08:33 PM -
LOG4j Logging in Separate Files for Threads
By krishna_85 in forum New To JavaReplies: 0Last Post: 03-05-2009, 04:23 PM -
working with files (text files)
By itaipee in forum New To JavaReplies: 1Last Post: 02-24-2009, 11:38 AM -
Behaving text files like binary files
By Farzaneh in forum New To JavaReplies: 2Last Post: 08-27-2008, 03:20 PM -
Text and image files within jar files
By erhart in forum Advanced JavaReplies: 8Last Post: 01-19-2008, 04:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks