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

Support for logging in ibm_db_dbi module #954

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,31 @@ True
True
```

## Logging

### Logging in ibm_db_dbi Module
You can enable logging in the ibm_db_dbi module to debug and trace activities.
Logging can be directed to the console or a specified file.

To enable logging:
```
import ibm_db_dbi as dbi

# Log to console
dbi.debug(True)

# Log to a file (e.g., log.txt)
dbi.debug("log.txt")

# stop logging
dbi.debug(False)
```
Calling dbi.debug(True) with boolean True argument will output logs to the console.

Calling dbi.debug("log.txt") will log messages to the specified file (log.txt in this example).

Calling dbi.debug(False) with boolean False argument will stop logging.

## Example of SSL Connection String

* **Secure Database Connection using SSL/TSL** - ibm_db supports secure connection to Database Server over SSL same as ODBC/CLI driver. If you have SSL Certificate from server or an CA signed certificate, just use it in connection string as below:
Expand Down
Loading
Loading