This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Just tried this and get the same result as you, I'd be lieing if I said I knew why, but have experimented and think its something to do with using the same stream in each logger, possibly different threads accessing the same stream ?.
If the method to create the handler creates a handle using a different FileOutputStream (outputting to different files) for each logger then it works as expected, and if it uses the same file then only the 1st logger outputs. I tried creating a handler that flushes the stream after each "publish" but that didn't have any effect.
I'd also be interested if anyone can shed any light on this.
Joined: Oct 20, 2006
Interestingly the following handler works as expected
The documentation for StreamHandler says "This is primarily intended as a base class or support class to be used in implementing other logging Handlers" implying that you're not expected to use it directly, think I need to read more on the Logging package in general to understand why it doesn't work as expected.