Skip to content
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

Can we log JDBC warnings as well? #62

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 6 comments
Open

Can we log JDBC warnings as well? #62

GoogleCodeExporter opened this issue Mar 25, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

I'm in process of debugging some triggers.

During this process, I've setup a series of "RAISE NOTICE" (PostgreSQL 
statement) that is captured by JDBC driver as SQLWarning.

No logger so far is able to capture SQLWarnings after statement execution.

Would be possible to add this feature to log4jdbc?

I would like to capture the SQL Statement (prepared or not) that resulted in a 
SQLWarning from database.


Thanks,

Edson

Original issue reported on code.google.com by [email protected] on 16 Jan 2013 at 11:26

@GoogleCodeExporter
Copy link
Author

I don't know how the driver could do that without calling getWarnings after 
every call which would be very inefficient. Do you know of any other way to do 
it?

Original comment by [email protected] on 17 Jan 2013 at 1:23

  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

@GoogleCodeExporter
Copy link
Author

Unfortunately, not.
If there are no warnings, the call to getWarnings is supposed to return null; 
At other side, if getWarnings() return non null value, it is necessary to call 
nextWarning in the SQLWarning object until it returns null.

I know it would be very expensive - but this is for debugging server side 
conditions only, never to keep in test or production systems.

Regards,

Edson

Original comment by [email protected] on 17 Jan 2013 at 1:33

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Seems like that could work. Did you try it?

Original comment by [email protected] on 17 Jan 2013 at 8:47

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

No, I've not.
My project works with JPA, and I don't have access to the underlining 
statements. That's why I was looking for the log solution  log4jdbc.

Original comment by [email protected] on 17 Jan 2013 at 9:35

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I meant did you modify log4jdbc to log the warnings and see if that worked?

Original comment by [email protected] on 17 Jan 2013 at 9:40

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

No, I've not. I'll give a try as soon as I get some spare time to understand 
the architecture and give some small steps into the code.

I was hoping that some configuration related to Warnings was able to do that 
already.

Right now, I need to finish these triggers.

Regards,

Edson

Original comment by [email protected] on 17 Jan 2013 at 9:46

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant