Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOgU0-008deT-Fd for pgsql-general@arkaria.postgresql.org; Wed, 26 Jul 2023 15:31:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qOgTy-005DrV-NN for pgsql-general@arkaria.postgresql.org; Wed, 26 Jul 2023 15:31:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOgTx-005DrM-4Z for pgsql-general@lists.postgresql.org; Wed, 26 Jul 2023 15:31:22 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOgTr-001hML-JO for pgsql-general@lists.postgresql.org; Wed, 26 Jul 2023 15:31:19 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2A3F05C0124; Wed, 26 Jul 2023 11:31:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 26 Jul 2023 11:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1690385474; x=1690471874; bh=o5pHHUG47ydtdLNGqkYw7wNdRAS1p2zfS99 KeIiKbgA=; b=KhadPGtLMjNdx+k4uJW41R173yt6wsl9WnJ242kNEW2tyWI9+1O u6G7jhMl8lTiqoKR5fNaC9YXZK9ksEbhNEtudDlWkmQRp69Ma/5dCQ999VcOiH04 nmxKxj4ojb0g1UQJicLD4VZv8Ama2K2ah+ZJ4vbmzKeqHktBCbFeGjV7E3gqzzDW yn9kbnLbd+NTTMFZjf3tj5AAJPlVOl9RswwKezEQZ3Sk9z2ztbeYW9W8U4nwiNI3 0wdOAsOxGqHOAIjUiFupWJqzlG1EQR/jFk479gWSfn7XSudhCpULy9l+df2IxfXH 0B6+9mj+8MJfJ+kcH/p0qhhBbRX9ug9T2DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1690385474; x= 1690471874; bh=o5pHHUG47ydtdLNGqkYw7wNdRAS1p2zfS99KeIiKbgA=; b=K vF4TqGfLY6ExuS0c9d8aSlDXq7aPvdPDpQBfn6WgxWoPFPGmev1hT5RlUAM2SltZ PV1aom5LTjJLoXVTi5bVitOSmGG1T0Q9cziIh3EOxGBYW433hQbrgbwmvgYBS1fk /XCnLrRH8B3pKja1on4DbhJ/vVzhoIjw2SQOOM5sHrlCtDyh7GSxLEf3nWBBm5yV IB2WvIFO3drDWIuvQBpYV6hMLXEV5aamtst3so49oLRYWtfpk8SUKsT/Q60JYbJS dmoDEqd1MNgQxfcwPebhTO8+o77lrsXqPp9r6W6naWwymdztcYSGHddkB8WvovTD djVaddhyEVxpxYFm6XP1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedriedvgdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepleekgeejhfekteehfeduveetheeivdduheekudelteef vdffueehtddvgedtfeefnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Jul 2023 11:31:13 -0400 (EDT) Message-ID: Date: Wed, 26 Jul 2023 08:31:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: logging_collector is off, but the logging is opening To: Wen Yi , pgsql-general References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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