Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.util.Logger creating multiple log files

 
Anant Jagania
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I created a My Logger class which holds object of java.util.Logger and in the constructor i am adding FileHandler to Logger.

Now this logger i used in all my class for logging purpose.

It seems that it is creating new new log files every time. When I run the my application it creates three log files at the same time.

Please let me know how to over come this.

Thanks,
Anant
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it'd make sense to post the actual code (and configuration, if any) you're using.
 
Anant Jagania
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code


 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are having to change your code to make it work the way you like, I suggest you take a quick look at Apache's log4j

It is widely used, more flexible, and there is an active support mailing list.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic