• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kashif, But I can't use the log4j,I an requierd to use the jave.util.logger .
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Kareem
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic