[Question posted by a user on YugabyteDB Community Slack]
What is the log_line_prefix value that YugabyteDB uses by default? Where can I see this value for my current deployment? A log statement captured from yb-tserver.INFO file is like below:
W0607 20:33:04.185003 34 log_util.cc:222] Could not read footer for segment: /mnt/disk0/yb-data/tserver/wals/table-b2f6b3c86b144801970a778a4108e5bd/tablet-c47ae2a0cd8342b0a225c0e2b88564c3/wal-000000077: Not found (yb/consensus/log_util.cc:464): Footer not found. Footer magic doesn't match
I want to make sense of what individual components refer to and if possible add few more prefixes.
My requirement is to capture audit logs. I noticed that YB audit logs go into postgres.*.log file and not yb-tserver.INFO for e.g. This was problematic because our log collection infra (kibana etc) is reading yb-tserver.INFO. I added
ysql_pg_conf_csv=pgaudit.log='ALL',pgaudit.log_level=log,pgaudit.log_client=ON,log_line_prefix='%m [%p] %q%u ',log_filename=yb-tserver.INFO
and this causes audit logs to go into yb-tserver.INFO but I noticed that audit logs don't show up in kibana. My theory was that the log prefix format of postgres log and yb logs are different. For e.g this is snippet from yb-tserver.INFO file after audit logs went there.
W0607 20:44:04.952666 2496 replica_state.cc:738] T 8c98cae947f6496391679c3884e9f173 P eb161bac2edb40f6856996f9818bf8a2 [term 179 LEADER]: Can't advance the committed index across term boundaries until operations from the current term are replicated. Last committed operation was: 178.292150, New majority replicated is: 178.292150, Current term is: 179
2022-06-07 21:13:56.410 UTC [23977] yugabyte LOG: AUDIT: SESSION,1,1,READ,SELECT,,,select 'kundan';,<not logged>
Notice that log-prefix format is different so I thought if I could make either postgres log prefix same as yb's, my log collection would be able to read/parse and it'll show up in kibana. Please advise if my plan is good. I don't think there is a way to configure yb log prefix like I could do for postgres?