Re: [HACKERS] WIP: Separate log file for extension

From: Jing Wang <jingwangian(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] WIP: Separate log file for extension
Date: 2018-01-29 04:29:35
Message-ID: CAF3+xMJVcR=-3ononhMNygHUS0rMnKO-4YVEJTedPf3nHeeC6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Antonin,

1. check-world run error as following:

for extra in contrib/adminpack; do make -C '../..'/$extra
DESTDIR='/db/pgmaster/postgres'/tmp_install install
>>'/db/pgmaster/postgres'/tmp_install/log/install.log || exit; done
In file included from ../../src/include/c.h:1135:0,
from ../../src/include/postgres.h:47,
from adminpack.c:15:
adminpack.c: In function ‘convert_and_check_filename’:
adminpack.c:84:38: error: ‘Log_directory’ undeclared (first use in this
function)
(!logAllowed || !is_absolute_path(Log_directory) ||

2. In function get_log_stream

The following code
if (strcmp(id, stream->id))
ereport(ERROR,
(errmsg("log stream with id \"%s\" already exists", id)));

should be " if (strcmp(id,stream->id)==0)" ?

3. In function pipeThread

csvlog_file can't be found but referred by the following statements:

if (ftell(syslog_file) >= Log_RotationSize * 1024L ||
(csvlog_file != NULL &&

4. In logfile_open function
LogStream *stream = &log_streams[stream_id];
int file_mode = stream->file_mode;

It may be better to be as following:
int file_mode = log_streams[stream_id].file_mode

--
Regards,
Jing Wang
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2018-01-29 04:31:09 Re: Redefining inet_net_ntop
Previous Message Amit Langote 2018-01-29 04:21:54 Re: Boolean partitions syntax