Re: [HACKERS] get current log file

2016-02-29 Thread Armor
t;; "pgsql-hackers"<pgsql-hackers@postgresql.org>; Subject: Re: [HACKERS] get current log file On Fri, Feb 26, 2016 at 8:31 AM, Armor <yupengst...@qq.com> wrote: > I think I know what you are concerned about. May be I did not explain my > solution very clearly. &g

Re: [HACKERS] get current log file

2016-02-26 Thread Armor
uot;<robertmh...@gmail.com>; Cc: "Euler Taveira"<eu...@timbira.com.br>; "Armor"<yupengst...@qq.com>; "Alvaro Herrera"<alvhe...@2ndquadrant.com>; "Pgsql Hackers"<pgsql-hackers@postgresql.org>; Subject: Re: [HACKERS] get c

Re: [HACKERS] get current log file

2016-02-26 Thread Tom Lane
Euler Taveira writes: > Those are good concerns. Also, we already have emit_log_hook that could > grab server log messages. A small extension using the hook (there are > some out there) could be use with a log consuming tool. Hmmm ... emit_log_hook runs in the process

Re: [HACKERS] get current log file

2016-02-26 Thread Euler Taveira
On 26-02-2016 11:50, Tom Lane wrote: > This needs to be explained a lot more clearly than it has been so far, > else we are going to reject this proposed feature as being more code and > more overhead than is justified. Exactly why would you need a pointer to > the current log file, rather than

Re: [HACKERS] get current log file

2016-02-26 Thread Tom Lane
Euler Taveira writes: > On 26-02-2016 08:03, Robert Haas wrote: >> But there's one thing I'm slightly baffled about: why would you >> actually need this? > The use case I have in mind is consume log file by using a tool like > logstash. In this case, logstash accepts

Re: [HACKERS] get current log file

2016-02-26 Thread Euler Taveira
On 26-02-2016 08:03, Robert Haas wrote: > I don't think we're going to accept this feature if it might fail in > corner cases. And that design seems awfully complex. > Agree. > The obvious way to implement this, to me at least, seems to be for the > syslogger to write a file someplace in the

Re: [HACKERS] get current log file

2016-02-26 Thread Robert Haas
On Fri, Feb 26, 2016 at 8:31 AM, Armor wrote: > I think I know what you are concerned about. May be I did not explain my > solution very clearly. > (i) Using a variable named last_syslogger_file_time replace > first_syslogger_file_time in syslogger.c. When postmaster

Re: [HACKERS] get current log file

2016-02-25 Thread Tom Lane
Robert Haas writes: > On Thu, Feb 25, 2016 at 1:15 AM, Euler Taveira >> wrote: >>> To pass last_syslogger_file_time, we have 2 solutions: 1, add a >>> global variable to record last_syslogger_file_time which shared by >>> backends and syslogger, so

Re: [HACKERS] get current log file

2016-02-24 Thread Robert Haas
On Thu, Feb 25, 2016 at 1:15 AM, Euler Taveira wrote: > On 02-02-2016 10:22, Armor wrote: >> As we known, the name of current log file depends on the number of >> seconds (for simple, later I will call it last_syslogger_file_time) >> since Epoch when create new log

Re: [HACKERS] get current log file

2016-02-24 Thread Euler Taveira
On 02-02-2016 10:22, Armor wrote: > As we known, the name of current log file depends on the number of > seconds (for simple, later I will call it last_syslogger_file_time) > since Epoch when create new log file. So, for this feature, the key is > how syslogger process pass

Re: [HACKERS] get current log file

2016-02-24 Thread Armor
. -- Jerry Yu -- Original -- From: "Alvaro Herrera";<alvhe...@2ndquadrant.com>; Date: Tue, Feb 2, 2016 06:30 PM To: "Armor"<yupengst...@qq.com>; Cc: "pgsql-hackers"<pgsql-hackers@postgresql.org>

Fw: Re: [HACKERS] get current log file

2016-02-24 Thread Armor
Alvaro Herrera"<alvhe...@2ndquadrant.com>; Subject: Re: [HACKERS] get current log file As we known, the name of current log file depends on the number of seconds (for simple, later I will call it last_syslogger_file_time) since Epoch when create new log file. So, for this feature,

[HACKERS] get current log file

2016-02-02 Thread Armor
Hello, I find there is a new feature about getting current log file name on the TODO list (for detail please check http://www.postgresql.org/message-id/pine.gso.4.64.0811101325260.9...@westnet.com). On the other side, we finish a ticket to this requirement for our customer. If the PG

Re: [HACKERS] get current log file

2016-02-02 Thread Alvaro Herrera
Armor wrote: > Hello, > > > I find there is a new feature about getting current log file name on the > TODO list (for detail please check > http://www.postgresql.org/message-id/pine.gso.4.64.0811101325260.9...@westnet.com). > On the other side, we finish a ticket to this requirement for