-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement suggestion : log auto-committed statements in a special way #484
Comments
@the-w1nd thanks for the idea. Any chance to raise it as a pull request? it would be easier for tracking I guess. The only thing is, that I guess it should be covered with the feature flag (to be backwards compatible). @gavlyukovskiy ideas? |
@typekpb , the 5 lines that I changed in the code are pretty dumb. so I did not bother with making a pull-request. And considering keeping the backwards compatibility, would have to be implemented in some other way. Perhaps, the "autocommitted" flag can just be added as a new tag in the "CustomLineFormat" class, so everything would be backwards compatible, until someone uses the tag. |
I like this idea, thank you!
I think it's a good option, the only issue is that |
@gavlyukovskiy sounds good. So it would mean that people would have to define the:
to make it happen (or whatever format they preffer), right? |
@typekpb that's right, I would only swap |
OK, for changing the default format, I would be rather worried, as people
might be used to existing one. But to have it as an option is fine with me.
…On Thu, Aug 8, 2019 at 5:44 PM Arthur Gavlyukovskiy < ***@***.***> wrote:
@typekpb <https://github.com/typekpb> that's right, I would only swap
%(sqlSingleLine) and %(attributes), because first one usually quite long.
I think we can even change default format to include that, I wouldn't say
changing log format breaks backward compatibility.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#484?email_source=notifications&email_token=AAD2A3GNJK4TYYB4UFBPVZLQDQ5NRA5CNFSM4IKEA2A2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD34BGAA#issuecomment-519574272>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD2A3E3AC3E3SIMPS4GA2TQDQ5NRANCNFSM4IKEA2AQ>
.
|
Okay ... now it's starting to get into an interesting shape that could be an awesome feature for the library! But as you mentioned, every Category will have many attributes that would be interesting to see under various circumstances - for example,
This would bring the possibility of peeking the Metadata of the Connection and pulling some interesting attributes out of it - it's been a long struggle for me to separate a single log file for multiple ConnectionPools in the AppServer. Since every ConnectionPool connects to its own schema, if I could retrieve and log I better stop before I get carried away. :) |
@the-w1nd well, I have a bad news here. For the things you mentioned, you should better introduce the custom implementation programically, using:
As going for the full configurability moves us the way towards reflection and parsing the string => makes things sloooow. Now as you moved it a bit forward, I wonder if introducing @gavlyukovskiy ideas? |
Reflection is definitely not what I had in mind, because it will definitely drag the ... performance down. I was more thinking about caching the particular attribute values within Regarding writing a custom logger class - it would not have necessary access to the actual objects, because it gets a fixed set of property values (see the com.p6spy.engine.spy.appender.MessageFormattingStrategy interface). |
@the-w1nd you can actually go deeper and override
probably this can be solved with @typekpb I agree that we can't fulfill everyone's needs with default format, including too much will definitely hurt performance. Even now I'm not really happy that |
@gavlyukovskiy sounds like this one might be a candidate for closing. |
If you guys don't see an easy way to approach or implement the feature, I'll try to take a stab at it when I get some spare time. |
I'll give it a shot. If something good is going to come out, I'll create a pull request for review. |
@the-w1nd perfect, thanks! |
Guys, after some learning curve, I believe I created my first ever GitHub Pull Request #485 . Let me know if I did something wrong in the Pull, and please share any comments you might have on the code changes. They are just a proof-of-concept for now and need your guidance if they are in the right direction. Thanks! |
Have you had a chance to take a look at the changes? Just wondering if you need more time, or if I did something wrong with the draft pull request? My intention was to collect any comments and suggestions before continuing changing the code. Any guidance would be appreciated. |
hello, sorry for no response on that. I'm super-busy these days to be honest. can't promise any timeline yet. |
No worries and no rush. Since this was my first pull request on GitHub, I was worried if I did something wrong with it. Please do take your time and let me know what you think about it. |
@the-w1nd looked at this a long time ago and the problem was that it changes too many interfaces that people can use. It makes it impossible to do this change without breaking changes and I don't think this feature worth it. I've spent couple of days trying to figure out how to do it, but gave up. Although parameter |
First of all - HUGE thanks to everyone contributing and maintaining P6Spy! I've been using it for ages, but never had a chance to express my appreciation to you! Thanks a lot!
One enhancement I'd like to propose is for P6Spy to log Statements with a special message, which were executed on a Connection that had Auto-Commit flag set to TRUE. Since such Statements do not require explicit calls for "commit", it is hard to figure out the transactional boundaries for such calls, so "marking" them in the log would be a big benefit.
The least intrusive way to make the distinction is by listing the Category for such Statements with a new value (e.g. "statement-autocommitted"). But people more familiar with the P6Spy code and its structure will most likely propose a more elegant solution. Please have a look at the attached patch-file that I generated on 3.8.2 release, and let me know if you have any questions or suggestions.
Thanks again!
The text was updated successfully, but these errors were encountered: