Problem with java.util.logging - writing to multiple log files
Dave Jones
Ranch Hand
Joined: Feb 20, 2005
Posts: 77
posted
0
Hi ranchers..,
I'm having trouble with logging to multiple files - I am using the constructor for creating multiple files with size limitation- FileHandler(Stringpattern, 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
posted
0
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
posted
0
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
posted
0
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