• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on java.util.logging configuration  RSS feed

 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I want to configure jdk14 logging, and I'm kind of lost on this issue - I want to log to file,s and sometimes I want separate files for my loggers. For example, I want everything in server.log file, but I want my DAOs to log to dao.log. As far as I gathered from what I could find on the net, it is only possible to specify handlers for a given logger name using their class names, and configure the handlers only once per class name. So, it would mean I cannot configure two file handlers with different file names?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37462
537
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raf,
You can, but you need to extend the default properties file (or use a Java based configuration.) You would create your own properties to reflect the extra types. You would also need to write your own loader (and delegate to the built in one where appropriate) and intercept all logging calls to write to the multiple file handlers.
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I stated the question incorrectly - of course, I can do it if I mess with the code, I should have asked if it was possible by default. Looks like it's not, which seems pretty limiting.
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!