aspose file tools
The moose likes Java in General and the fly likes Problem with java.util.logging - writing to multiple log files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Problem with java.util.logging - writing to multiple log files" Watch "Problem with java.util.logging - writing to multiple log files" New topic
Author

Problem with java.util.logging - writing to multiple log files

Dave Jones
Ranch Hand

Joined: Feb 20, 2005
Posts: 77
Hi ranchers..,

I'm having trouble with logging to multiple files - I am using the constructor for creating multiple files with size limitation-
FileHandler(String pattern, int limit, int count, boolean append).



The problem I encounter is that it writes to the next log file before exceeding the limit, can it be because of file-lock or something? what can I do in order to fill log files in a given limit and then write to the next?
thanks, Dave
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
Can't help with your problem but log4j could do this very easily, without having to write any Java code. You can direct output to a console, multiple files, emails and so on by just changing a properties file.
Dave Jones
Ranch Hand

Joined: Feb 20, 2005
Posts: 77
Thanks Kashif, But I can't use the log4j,I an requierd to use the jave.util.logger .
Kareem Qureshi
Ranch Hand

Joined: Mar 14, 2002
Posts: 102
Hi,

log4j is now java.util.logging so you should be able to do it using properties files.

Thanks,
Kareem
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Originally posted by Kareem Qureshi:

log4j is now java.util.logging


Nope, it's sure not. log4j is a somewhat richer alternative to java.util.logging.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with java.util.logging - writing to multiple log files
 
Similar Threads
Parsing huge file without reading into memory
log4j - limit numer of log Files for DailyRollingFileAppender
Java Compress Multiple files as zip file
Writing logs to a single file from Multiple Classes
Java util Logging : FileHandler