[MXS-4385] Allow option to log maxscale log entries into one line rather than spanning multiple lines. Created: 2022-11-08  Updated: 2023-07-24  Resolved: 2023-06-12

Status: Closed
Project: MariaDB MaxScale
Component/s: maxbase
Affects Version/s: 6.4.1
Fix Version/s: 23.08.0

Type: New Feature Priority: Minor
Reporter: Henry Hwang (Inactive) Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: CustomerRequest, feature_request

Sprint: MXS-SPRINT-184

 Description   

Some MaxScale log entries span more than one line which makes it difficult for a customer's datadog application to parse and ingest. It would be nice to have a configurable option to allow maxscale to write single row log entries rather than across multiple lines. This appears to occur when maxscale is logging a query. It may be like this because maxscale is preserving the newlines as submitted by the application, but it would still be nice to have an option to put it all in one line.

Here's a sample log entry with the table and column names obfuscated but the line breaks intact:

2022-11-01 15:30:29   info   : (850) > Autocommit: [disabled], trx is [open], cmd: (0x03) COM_QUERY, plen: 491, type: QUERY_TYPE_READ, stmt: SELECT col1,col2,col3,col4,
col5, col6, col7,col8,col9,
col10,col11, col12, col13,
col14 FROM tbl WHERE col1 IN (12345)
AND (col2 !=0 OR col3 !=0 OR col4 !=0 OR
col5 !=0 OR col6 !=0 OR col7 !=0
 OR col8 !=0)

Customer is currently running with MaxScale 6.4.1.



 Comments   
Comment by markus makela [ 2022-11-09 ]

Can you use journalctl as the data source? The entries are stored in a structured form there which should allow you to capture the complete output.

I do agree that eliminating newlines from the log output would be good as it would simplify manual parsing of it and would make it easier to integrate into log software that does not support systemd-journal.

Comment by Johan Wikman [ 2022-11-09 ]

I would be inclined to consider it a bug that the newlines are preserved; a log entry should be a single line without newlines.

Comment by Henry Hwang (Inactive) [ 2023-01-09 ]

I did share the suggestion of using journalctl but am wondering if this is going to be addressed from the MaxScale end too?

Thanks!

Generated at Thu Feb 08 04:28:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.