darkgoon83 / log4jdbc-remix

Automatically exported from code.google.com/p/log4jdbc-remix
0 stars 0 forks source link

One cannot use different custom log formatters on different data sources. #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. my application uses two data sources connecting to different databases.
2. to distinguish between the two I use different log formatters with different 
prefix.

What is the expected output?
 It is expected, that one could see the right prefix when logging a transaction for data source 1 / 2.
What do you see instead?
 the prefix is always the same.
Looking at the code shows that a static singleton is used to store / ref the 
log formatter.

What version of the product are you using? On what operating system?
0.2.6, win7, jdk 1.6_027

Please provide any additional information below.

Original issue reported on code.google.com by ske...@gmail.com on 25 Jan 2012 at 12:09

GoogleCodeExporter commented 8 years ago
Yes thats true, I think I inherited that design from log4jdbc. I will try to 
see if there is a simple fix.

Original comment by tim.azzo...@gmail.com on 27 Jan 2012 at 12:52

GoogleCodeExporter commented 8 years ago
I already developed a solution and will send you a diff to 0.2.6. hold on.

br steve

Original comment by ske...@gmail.com on 27 Jan 2012 at 6:57

GoogleCodeExporter commented 8 years ago
Here is a diff, adding an additional parameter in most construtors and an 
additional field, that holds a reference to the log formatter.

br steve

Original comment by ske...@gmail.com on 27 Jan 2012 at 7:55

Attachments:

GoogleCodeExporter commented 8 years ago
Thats great, thank you, I will take a look this weekend.

Original comment by tim.azzo...@gmail.com on 27 Jan 2012 at 8:36

GoogleCodeExporter commented 8 years ago
Thanks a lot for your patch, I've committed the code and release it under 
0.2.8-SNAPSHOT.

I will release it as 0.2.8 if there are no bugs found. But it looks good to me!

Thanks again.

Original comment by tim.azzo...@gmail.com on 28 Jan 2012 at 11:09