Currently my db has a couple of triggers for some (not all) tables that get executed when a specific number of columns has been updated. I keep track if the triggers for those rows on a boolean column in the tables.
Id like to be able to log UPDATE and INSERT queries and the errors/warnings coming from them onto different files in my postgresql server as a singular log file can get quite big.
Ive thought of a couple of approaches to this problem and am looking for a better approach than these;
have the triggers (plpython3) create seperate log files when they only get called (not a lot but they insert millions of rows onto different tables.
write additional triggers that insert logging information onto another table (either by explicit means or a single JSON column)
thank you for your time and answers!