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

libgixsql-pgsql error logging defect #84

Closed
GitMensch opened this issue Jul 6, 2022 · 3 comments
Closed

libgixsql-pgsql error logging defect #84

GitMensch opened this issue Jul 6, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@GitMensch
Copy link
Contributor

GitMensch commented Jul 6, 2022

I'm currently hunting down an error and had a look at the error logging:

[2022-07-06 07:29:44.044] [libgixsql-pgsql] [error] libpq:
[2022-07-06 07:29:44.047] [libgixsql] [error] Can't find a connection

... looks like the actual error message from libpg is missing :-(

Note: the trace log is better in all places that are self-generated (it is "just" the error message from libpg that is missing)

[2022-07-06 08:02:34.495] [libgixsql] [info] GixSQL logger started
[2022-07-06 08:02:34.524] [libgixsql] [debug] ../../../runtime/libgixsql/gixsql.cpp>GIXSQLConnect: GIXSQLConnect start
[2022-07-06 08:02:34.528] [libgixsql] [debug] loading DB provider: ../../../runtime/libgixsql/DbInterfaceFactory.cpp
[2022-07-06 08:02:34.531] [libgixsql] [debug] Accessing DB provider: ../../../runtime/libgixsql/DbInterfaceFactory.cpp
[2022-07-06 08:02:34.531] [libgixsql-pgsql] [info] libgixsql-pgsql logger started
[2022-07-06 08:02:34.531] [libgixsql] [trace] ../../../runtime/libgixsql/gixsql.cpp>GIXSQLConnect: Connection string : myerver:12345
[2022-07-06 08:02:34.531] [libgixsql] [trace] ../../../runtime/libgixsql/gixsql.cpp>GIXSQLConnect: Data source info  :
[2022-07-06 08:02:34.531] [libgixsql] [trace] ../../../runtime/libgixsql/gixsql.cpp>GIXSQLConnect: Autocommit        : false
[2022-07-06 08:02:34.531] [libgixsql-pgsql] [trace] ../../../runtime/libgixsql-pgsql/DbInterfacePGSQL.cpp>connect: PGSQL::connect - autocommit: 0, encoding: LATIN9
[2022-07-06 08:02:34.531] [libgixsql-pgsql] [trace] libpq - connection std::string: [host=myserver port=12345 user=myuser password=mypass ]
[2022-07-06 08:02:34.550] [libgixsql-pgsql] [error] libpq:

... it looks like that "Data source info" may miss some information, too - but I guess that only serves as a "title" to the next line?

Side note: Interestingly the "debug" level has less information than the "trace", I would have thought it to be the other way around.

GitMensch added a commit to GitMensch/gixsql that referenced this issue Jul 6, 2022
@mridoni mridoni added the bug Something isn't working label Jul 6, 2022
@mridoni
Copy link
Owner

mridoni commented Jul 6, 2022

Yes, connection errors are not logged properly, I cannot test it right now, but this patch should fix it.

issue-84.patch.txt

@GitMensch
Copy link
Contributor Author

I came to the same conclusion.
Note: the logging for "libpq - connection" should also output the dbname (its emptiness was the reason for the error, as seen in #24). It may is not logged because it is empty - but even then a log entry showing that would be useful.

mridoni added a commit that referenced this issue Jul 13, 2022
- Added support for "smart" cursor initialization (#88)
- Added support for EXECUTE prepared-statement INTO #(87)
- Fixed a logging problem (#84)
- Fixed "wrong generated COBOL in 1.0.16" (#83)
- Fixed "missing "close" for spdlog?" (#82)
- Added support for using prepared statements in cursors (#81)
- Variable length fields indicators are now 32-bit long by default (#80)
- Added support for using variable length fields with prepared statements (#79)
- Added upport for using group fields in INSERT and SELECT..INTO statements (#6)
- Added support for more connection string formats (including ocesql compatibility) (#16)
- Added Support for DISCONNECT ALL (#89)
- Performed some refactoring to improve code size
- Fixed a few memory leaks
@GitMensch
Copy link
Contributor Author

fixed in 1.0.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants