-
Notifications
You must be signed in to change notification settings - Fork 171
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
[SNOW-804206] 3. Instantiate JDK14Logger with sf client configuration #1384
Conversation
2a804c1
to
ae35134
Compare
ae35134
to
d5005d9
Compare
SonarQube Quality Gate |
(String) connectionPropertiesMap.getOrDefault(SFSessionProperty.TRACING, null); | ||
|
||
Level logLevel = null; | ||
String logPattern = "%t/snowflake_jdbc%u.log"; // default pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if %t for time and %u for user then can we switch it? like %u/snowflake_jdbc_%t.log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfc-gh-igarish We could. But we currently use %t/snowflake_jdbc%u.log
this format so I kept it as-is for backward compatibility.
ref: https://github.com/snowflakedb/snowflake-jdbc/blob/master/src/main/java/net/snowflake/client/log/JDK14Logger.java#L288
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Make sure it creates unique file when run concurrently in a server environment.
Overview
SNOW-804206
The SF CONFIG file introduces various logging possibilities when used in conjunction with the
tracing
connection property andlogging.properties
for JDK14Logger. Please note that the SF CONFIG file is only applicable toJDK14Logger
asSL4JLogger
cannot be instantiated.If
-Djava.util.logging.config.file
system property is not defined, the following actions will be taken:- Check log level from config file
- Default value is Level.OFF
- If there are permission errors, throws a SQLException
- If no output path value is found in LogPath, defaults to java.io.tmpDir
External contributors - please answer these questions before submitting a pull request. Thanks!
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes #NNNN
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
Pre-review checklist