Help save net neutrality! Learn more.
Close

#11 Configurable logging level of SQL Warnings

closed
nobody
None
5
2007-01-16
2007-01-05
al0
No

Hello,

clearing of SQL Warnings before making chacked-in connection available as part of pool is indisputably proper decision, but logging of all these warnings on WARNING level - not.

In reality SQL Warnings very rarely represents real warnings, as mostly they do not point or hint that something is (or may be) abnormal. Rather, they provide some additional information.

The only SQL Warning that is really standard and can be met in all (at least, almost all) databases is that UPDATE or DELETE statement has not found any records to process, which is not of greater interest that information that 1 record or 1 million records were processed.

All other SQL Warnings are highly DB-dependent. E.g. in SQL Server SQL-Warnings are used to provide some kind of debug output from server (like to println() functinality).

For this reasons forceful logging all of them on WARNING level may overflow logs with garbage, effectively hiding really important information.

In my opinion, it would be much better if log level for SQL Warnings will be configurable.

Regards,
Oleksandr Alesinskyy

Discussion

  • Steve Waldman

    Steve Waldman - 2007-01-05

    Logged In: YES
    user_id=175530
    Originator: NO

    So maybe in the future, they can be configurable. Right now c3p0-0.9.1 is "feature-frozen", I hain't adding new config params. By default, you think that these should be at DEBUG (log4j), FINE(jdk1.4) log level, so that most users simply never see them? (Changing the default log level I can do now, and I'm open to this change.)

    smiles,
    Steve

     
  • al0

    al0 - 2007-01-05

    Logged In: YES
    user_id=1618512
    Originator: YES

    I see your point. For time beeng I would suggest INFO, as information from SQL-Warnings is useful, but is by no means critical, and it is quite common practice to log all messages of level WARNINIG and above in one log-file, all all enabled messages in other.

    If SQL-Warnings will be logged at INFO they would not garbage forst log file intended for important messages, but would be available in the second file intended for detailed analysis.

    And for future configurability is very desirable.

    Regards,
    Oleksandr

     
  • Steve Waldman

    Steve Waldman - 2007-01-16
    • status: open --> closed
     
  • Steve Waldman

    Steve Waldman - 2007-01-16

    Logged In: YES
    user_id=175530
    Originator: NO

    Okay... sorry for the delay.

    As of c3p0-0.9.1 (to be released today), uncleared warnings are logged at INFO, and via a distinct logger ("com.mchange.v2.c3p0.SQLWarnings"), so that you can turn them off, redirect, whatever, via your logging configuration.

    I hope you find this workable, let me know if not

    smiles,
    Steve

     

Log in to post a comment.