Defect #2684
closedSome messages are missing in the Logging events
100%
Description
Tested on 10.7.2 when logger logs also in the DB. See the logback configuration in the attachment.
Some messages aren't saved in the logging events, e.g. when getting an invalid certificate with SSL connection.
(Connector test failed javax.naming.CommunicationException: simple bind failed: 172.31.255.180:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative names matching IP address 172.31.255.180 found])
Probably the message is too long.
Here are some errors from the PostgreSQL log (the first is caused by the wrong certificate, the others unknown).
2021-02-12 14:34:05.487 UTC [783] ERROR: value too long for type character varying(254) 2021-02-12 14:34:05.487 UTC [783] STATEMENT: INSERT INTO logging_event_exception (event_id, i, trace_line) VALUES ($1, $2, $3) 2021-02-03 12:34:02.812 UTC [758] ERROR: invalid byte sequence for encoding "UTF8": 0x00 2021-02-03 12:34:02.812 UTC [758] STATEMENT: INSERT INTO logging_event_exception (event_id, i, trace_line) VALUES ($1, $2, $3) 2021-02-03 14:21:00.326 UTC [1116] ERROR: invalid byte sequence for encoding "UTF8": 0x00 2021-02-03 14:21:00.326 UTC [1116] STATEMENT: INSERT INTO logging_event (timestmp, formatted_message, logger_name, level_string, thread_name, reference_flag, arg0, arg1, arg2, arg3, caller_filename, caller_class, caller_method, caller_line) VALUES ($1, $2, $3 ,$4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)
Files
Related issues
Updated by Petr Fišer almost 4 years ago
This one is AD connection with LDAP connector (plaintext LDAP) with bad credentials.
Feb 12 14:07:37 localhost czechidm-db[1190]: 2021-02-12 14:07:37.215 UTC [67] ERROR: invalid byte sequence for encoding "UTF8": 0x00 Feb 12 14:07:37 localhost czechidm-db[1190]: 2021-02-12 14:07:37.215 UTC [67] STATEMENT: INSERT INTO logging_event (timestmp, formatted_message, logger_name, level_string, thread_name, reference_flag, arg0, arg1, arg2, arg3, caller_filename, caller_class, caller_method, caller_line) VALUES ($1, $2, $3 ,$4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) Feb 12 14:07:37 localhost czechidm-db[1190]: #011RETURNING "event_id"
Updated by Radek Tomiška almost 4 years ago
- Status changed from New to In Progress
- Target version set to 10.8.0
Updated by Radek Tomiška almost 4 years ago
- Related to Defect #717: Cannot save 0x00 to Postgres column added
Updated by Radek Tomiška almost 4 years ago
- Related to Task #574: New agenda for LOGs added
Updated by Radek Tomiška almost 4 years ago
- Target version changed from 10.8.0 to 11.0.0
- Affected versions Citrine (7.3.0) added
- Affected versions deleted (
10.7.2)
Updated by Vít Švanda almost 4 years ago
- Assignee changed from Radek Tomiška to Vít Švanda
Updated by Vít Švanda almost 4 years ago
I was able simulated this. Bug is in the DBAppender https://jira.qos.ch/browse/LOGBACK-493.
ALTER TABLE public.logging_event_exception ALTER COLUMN trace_line TYPE text USING trace_line::text;
Updated by Vít Švanda almost 4 years ago
The solution in column extension in DB is functional, but not ideal (it would not work, for example, for H2 databases ...). Solving the second problem, replacing characters that cannot be stored in Postgresql, was not easy to solve because we do not have one place to solve this in IdM.
For these reasons, I implemented my own IdmDBAppender, which solves the above problems (max size and replacement of illegal characters u0000/x00).
Commit: https://github.com/bcvsolutions/CzechIdMng/commit/059f82c1b90ee3a2da4bb78351d117b1227960e9
Tests and documentation remains.
Updated by Vít Švanda almost 4 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Vít Švanda to Radek Tomiška
- % Done changed from 0 to 90
I implemented tests and changelog:
Commit: https://github.com/bcvsolutions/CzechIdMng/commit/9ccc7dd543b0168c1e6aad1a7eb0b415a4291b8a
I added note to wiki tutorials:
https://wiki.czechidm.com/tutorial/adm/czechidm_installation#create_czechidm_configuration
https://wiki.czechidm.com/tutorial/adm/czechidm_installation_win#create_czechidm_configuration
https://wiki.czechidm.com/devel/documentation/application_configuration/dev/backend?s[]=%2Ach&s[]=qos&s[]=logback&s[]=classic&s[]=db&s[]=dbappender%2A#jndi_datasource
Updated by Radek Tomiška almost 4 years ago
- Assignee changed from Radek Tomiška to Petr Fišer
I did test and code review, it works and code looks nice, our own appender is cool, thx!
Petr, could you please check documentation (mainly installation guides, appliance) from your point of view and add info about better db appender if needed?
Updated by Petr Fišer over 3 years ago
- Assignee changed from Petr Fišer to Vít Švanda
I checked the install guide and changelog and it looks ok. Thanks for updating it.
For future change in the IAM appliance, I created #2737 which we will implement once CzechIdM 11.0.0 is released.
I guess that's all, considering the documentation. Thanks for the fix. :)
Updated by Petr Fišer over 3 years ago
- Related to Task #2737: Adjust DB logging when CzechIdM 11.0.0 is released added
Updated by Radek Tomiška over 3 years ago
- Status changed from Needs feedback to Closed
- % Done changed from 90 to 100
Awesome, thx!