[PATCH] SQL function to report log message - Mailing list pgsql-hackers

From dinesh kumar
Subject [PATCH] SQL function to report log message
Date
Msg-id CALnrH7ocp-v5Zvs03_z-PMZgs8N1bB9t=AK_WkPenFK7NA_WBw@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] SQL function to report log message
Re: [PATCH] SQL function to report log message
List pgsql-hackers
Hi All,

Greetings for the day.

Would like to discuss on below feature here.

Feature:
    Having an SQL function, to write messages to log destination.

Justification:
    As of now, we don't have an SQL function to write custom/application messages to log destination. We have "RAISE" clause which is controlled by
log_ parameters. If we have an SQL function which works irrespective of log settings, that would be a good for many log parsers. What i mean is, in DBA point of view, if we route all our native OS stats to log files in a proper format, then we can have our log reporting tools to give most effective reports. Also, Applications can log their own messages to postgres log files, which can be monitored by DBAs too.

Implementation:
    Implemented a new function "pg_report_log" which takes one argument as text, and returns void. I took, "LOG" prefix for all the reporting messages.I wasn't sure to go with new prefix for this, since these are normal LOG messages. Let me know, if i am wrong here.

Here is the attached patch.

Regards,
Dinesh
manojadinesh.blogspot.com
Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [PATCH] Generalized JSON output functions
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] SQL function to report log message