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

fix:Do not set the loglevel when instantiating a connection it is set… #407

Merged
merged 1 commit into from Oct 26, 2015

Conversation

@davecramer
Copy link
Member

@davecramer davecramer commented Oct 24, 2015

… when the Driver starts

… when the Driver starts
@davecramer
Copy link
Member Author

@davecramer davecramer commented Oct 24, 2015

This fixes a problem where Driver.setLogLevel has no effect as the property over rides the value. One thing it does change is that it doesn't automatically set the LogWriter to stdout. Suggestions on how/if to handle this ?

davecramer added a commit that referenced this pull request Oct 26, 2015
fix:Do not set the loglevel when instantiating a connection it is set…
@davecramer davecramer merged commit b17eda1 into pgjdbc:master Oct 26, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@whitingjr

This comment has been minimized.

Copy link
Contributor

@whitingjr whitingjr commented on org/postgresql/jdbc2/AbstractJdbc2Connection.java in 84b28eb Dec 1, 2015

Removing this line causes all debug logging to be turned off when using a DataSource. This makes low level debugging far more difficult.
What is being fixed by this line being removed ?

This comment has been minimized.

Copy link
Member Author

@davecramer davecramer replied Dec 1, 2015

Ah, right, now I recall. If you do something like org.postgresql.Driver.setLogLevel. this line reverts that change unless you have the property externally set as per your DataSource configuration

@davecramer

This comment has been minimized.

Copy link
Member Author

@davecramer davecramer commented on 84b28eb Dec 1, 2015

Interesting catch-22 it caused debugging to be turned off when not using a DataSource

@whitingjr
Copy link
Contributor

@whitingjr whitingjr commented Dec 1, 2015

hmm yes interesting.
The default log level of 0 is loaded . If the default were to be null the connectionLogLevel reference would be null. Making programmatic and properties bundle loading compatible.
Ideally a default value of 0 should be loaded as a last resort. Making property setting precedence:

  1. Datasource property, 2) Programmatic, 3) Default value
    Do you agree ?
@davecramer
Copy link
Member Author

@davecramer davecramer commented Dec 1, 2015

Yes, that would work for me

@whitingjr
Copy link
Contributor

@whitingjr whitingjr commented Dec 1, 2015

Ok I'll create an issue #436 and a PR. We can see what you think of the proposed changes.

@whitingjr

This comment has been minimized.

Copy link
Contributor

@whitingjr whitingjr commented on org/postgresql/jdbc2/AbstractJdbc2Connection.java in 84b28eb Dec 8, 2015

with this line removed the DriverManager.logWriter object is always null. which disables info/debug logging.
Did you intend to replace this line with something else to set up logging ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.