pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
logging_collector is off, but the logging is opening
2+ messages / 2 participants
[nested] [flat]

* logging_collector is off, but the logging is opening
@ 2023-07-25 21:43  Wen Yi <wen-yi@qq.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Wen Yi @ 2023-07-25 21:43 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Hi community,
When I use the postgres, I check the log.(I use the -l open the log)
As you can see, I type code like this:



postgres=# show logging_collector;
&nbsp;logging_collector 
-------------------
&nbsp;off
(1 row)

postgres=# ^C


Follow the document, when logging_collector is off, there's no log output, but when I check my 'postgres' directory:


[postgres@fedora postgres]$ ls
build.sh&nbsp; logfile&nbsp; src&nbsp; startdb.sh&nbsp; stopdb.sh&nbsp; update.sh

[postgres@fedora postgres]$ cat logfile
2023-07-24 09:54:59.668 CST [35872] LOG:&nbsp; starting PostgreSQL 17devel on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4), 64-bit
2023-07-24 09:54:59.668 CST [35872] LOG:&nbsp; listening on IPv6 address "::1", port 5432
2023-07-24 09:54:59.668 CST [35872] LOG:&nbsp; listening on IPv4 address "127.0.0.1", port 5432
2023-07-24 09:54:59.684 CST [35872] LOG:&nbsp; listening on Unix socket "/tmp/.s.PGSQL.5432"
...


In a word, the log is actually open. (My startup command: pg_ctl -l logfile /home/postgres/postgres/bin/bin/pg_ctl -l logfile -D /home/postgres/postgres/data start)

So It's confuse me, the confilt of logging_collector &amp; logfile.


Can someone give me some advice?
Thanks in advance!


Yours,
Wen Yi

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: logging_collector is off, but the logging is opening
@ 2023-07-26 15:31  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Wen Yi <wen-yi@qq.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Adrian Klaver @ 2023-07-26 15:31 UTC (permalink / raw)
  To: Wen Yi <wen-yi@qq.com>; pgsql-general <pgsql-general@lists.postgresql.org>

On 7/25/23 14:43, Wen Yi wrote:
> Hi community,
> When I use the postgres, I check the log.(I use the -l open the log)
> As you can see, I type code like this:
> 
> postgres=# show logging_collector;
>   logging_collector
> -------------------
>   off
> (1 row)
> 
> postgres=# ^C
> 
> Follow the document, when logging_collector is off, there's no log 
> output, but when I check my 'postgres' directory:
> 
> [postgres@fedora postgres]$ ls
> build.sh  logfile  src  startdb.sh  stopdb.sh  update.sh
> [postgres@fedora postgres]$ cat logfile
> 2023-07-24 09:54:59.668 CST [35872] LOG:  starting PostgreSQL 17devel on 
> x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.1.1 20230614 (Red Hat 
> 13.1.1-4), 64-bit
> 2023-07-24 09:54:59.668 CST [35872] LOG:  listening on IPv6 address 
> "::1", port 5432
> 2023-07-24 09:54:59.668 CST [35872] LOG:  listening on IPv4 address 
> "127.0.0.1", port 5432
> 2023-07-24 09:54:59.684 CST [35872] LOG:  listening on Unix socket 
> "/tmp/.s.PGSQL.5432"
> ...
> 
> In a word, the log is actually open. (My startup command: pg_ctl -l 
> logfile /home/postgres/postgres/bin/bin/pg_ctl -l logfile -D 
> /home/postgres/postgres/data start)
> So It's confuse me, the confilt of logging_collector & logfile.
> 
> Can someone give me some advice?

https://www.postgresql.org/docs/current/runtime-config-logging.html


Note

It is possible to log to stderr without using the logging collector; the 
log messages will just go to wherever the server's stderr is directed. 
However, that method is only suitable for low log volumes, since it 
provides no convenient way to rotate log files. Also, on some platforms 
not using the logging collector can result in lost or garbled log 
output, because multiple processes writing concurrently to the same log 
file can overwrite each other's output.


https://www.postgresql.org/docs/current/app-pg-ctl.html

-l filename
--log=filename

     Append the server log output to filename. If the file does not 
exist, it is created. The umask is set to 077, so access to the log file 
is disallowed to other users by default.


> Thanks in advance!
> 
> Yours,
> Wen Yi

-- 
Adrian Klaver
adrian.klaver@aklaver.com






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-07-26 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 21:43 logging_collector is off, but the logging is opening Wen Yi <wen-yi@qq.com>
2023-07-26 15:31 ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox