How to create a log file in pg_log directory for each execution of my function.

Started by Raghavendra Rao J S Vover 7 years ago3 messagesgeneral
Jump to latest
#1Raghavendra Rao J S V
raghavendrajsv@gmail.com

Hi All,

I have a log file as "
*/opt/postgres/9.2/data/pg_log/postgresql-2018-08-19.csv*". Due to "
*log_rotation_age=1d*", one log file will be created for me in this pg_log
directory on everyday.

While I am debugging a particular user defined function which contains the
lot of raise notice messages , I would like to create a new log file
instead of appending the logs to existing one. How to achieve this?

Like this each and every execution of my function, I wold like to get a new
log file. How to do this.

--
Regards,
Raghavendra Rao J S V

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Raghavendra Rao J S V (#1)
Re: How to create a log file in pg_log directory for each execution of my function.

On 08/19/2018 10:22 AM, Raghavendra Rao J S V wrote:

Hi All,

I have a log file as "
*/opt/postgres/9.2/data/pg_log/postgresql-2018-08-19.csv*".  Due to
"*log_rotation_age=1d*", one log file will be created for me in this
pg_log directory on everyday.

While I am debugging a particular user defined function which contains
the lot of raise notice  messages , I would like to create a new log
file instead of appending the logs to existing one. How to achieve this?

Like this each and every execution of my function, I wold like to get a
new log file. How to do this.

https://www.postgresql.org/docs/10/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL

pg_rotate_logfile() boolean Rotate server's log file

--
Regards,
Raghavendra Rao J S V

--
Adrian Klaver
adrian.klaver@aklaver.com

#3Raghavendra Rao J S V
raghavendrajsv@gmail.com
In reply to: Adrian Klaver (#2)
Re: How to create a log file in pg_log directory for each execution of my function.

Thanks a lot.

On Sun 19 Aug, 2018, 11:09 PM Adrian Klaver, <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 08/19/2018 10:22 AM, Raghavendra Rao J S V wrote:

Hi All,

I have a log file as "
*/opt/postgres/9.2/data/pg_log/postgresql-2018-08-19.csv*". Due to
"*log_rotation_age=1d*", one log file will be created for me in this
pg_log directory on everyday.

While I am debugging a particular user defined function which contains
the lot of raise notice messages , I would like to create a new log
file instead of appending the logs to existing one. How to achieve this?

Like this each and every execution of my function, I wold like to get a
new log file. How to do this.

https://www.postgresql.org/docs/10/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL

pg_rotate_logfile() boolean Rotate server's log file

--
Regards,
Raghavendra Rao J S V

--
Adrian Klaver
adrian.klaver@aklaver.com