Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOSv1-0002if-AT for pgsql-general@arkaria.postgresql.org; Thu, 31 May 2018 19:07:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fOSuz-0005ZZ-AK for pgsql-general@arkaria.postgresql.org; Thu, 31 May 2018 19:07:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOSuy-0005ZQ-0E for pgsql-general@lists.postgresql.org; Thu, 31 May 2018 19:07:25 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOSuv-00055j-4O for pgsql-general@lists.postgresql.org; Thu, 31 May 2018 19:07:22 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 605F5216C5; Thu, 31 May 2018 15:07:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 31 May 2018 15:07:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=CHMvv4z7FV6ylUUqZdmeDbKdDBZ7V pWmVK9qZx8vEgk=; b=UwMoDjCcatDxIuzSRals9PqAmBbora/w8U2W9yaWRKUuH /+1biTT/9wdqkd74oga8MVFV7OYw5zMXVPtDHtr2s4ZYeZMLJPDcytKhXqiFlb/1 rW77Ph5wlaev+o+JauLhEHLgCVPEqR9aboGANDIWkgdO5dh6Givb8ENjJ3I6MZKf t6gQMq8yz2vNd7dfhfuDtZvbcTsVBeDkLHujQZ9JBMrg8qDyvaQVt/00c0HIExKz qCpUrrXG9UBYfukWqr8XP1+bxERZQlPQ2YGe2irNb5FKpbRhxyRpoMWvLFEtcQXx BmSsPhJsww4vG0RFioNeRxFHa81OFTTEu4qk/JkhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=CHMvv4 z7FV6ylUUqZdmeDbKdDBZ7VpWmVK9qZx8vEgk=; b=dWn0s8eA8RnWIOYpNrjLEw S/pNy5UuWMwn7S9hHWg/7+OtvHcKvYp5R+QUhuIRtTwTCbllxD8cahxhfNw00c59 nxqlfYJCXYlrLNeLYbO6n0OsPdUdCXb+g7zKwj7KZ/Yrx9DljjgJxb7w7+r2FDgV JdFDScZajHcDbuuOOiCHy2iTOy+W+sOC7wG4TZnZmWIQPUWX7ENEl4F6S06+oRrV ZEX56PIgq6QMjZb+NhsWaTi6NNnFWVRpNVyii0oU8XiLeJYq24OItymZX2Vm4ZNO FfPf73GjRsgf04+1NgLYQQps3BZajjU9IZBFInR6juZHUDR10qXM7iDWnNnSBPLQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id B3BC2E4648; Thu, 31 May 2018 15:07:19 -0400 (EDT) Subject: Re: unable to write 'raise' messages to log file? To: ib@ianbellsoftware.com, pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <91ee1e5f-171c-cbad-601a-d98ba97d42a9@aklaver.com> Date: Thu, 31 May 2018 12:07:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/31/2018 11:20 AM, Ian Bell wrote: > I am having considerable difficulty logging information in PL-pgSQL > functions by using the ‘RAISE’ statement.    I am asking for > comments/suggestions on what I am doing wrong. > > > I’ve tried flushing/rotating the log files by executing *‘select > pg_rotate_logfile()’* in PSQL but my messages never appear in the log > files.   I’ve tried calling my PL-pgSQL functions in PSQL, PgAdmin4, > OmniDB and ADO.NET but again my messages never appear in the log file. > > On very rare occasions, I see my messages the log file if I restart the > PostgreSql server however restarting the server generally does not flush > my messages to the log files. > Do they show up in a client? For example psql: test_(aklaver)> create or replace function TestWithBasicTypeArguments( i int, n numeric, t text) returns integer as $$ begin raise log 'Test.TestWithArguments: i = %, n = %, t = %', i, n, t; return 0; end; CREATE FUNCTION test_(aklaver)> set client_min_messages = 'debug1'; test_(aklaver)> select testwithbasictypearguments(1, 2.5, 'test'); LOG: Test.TestWithArguments: i = 1, n = 2.5, t = test testwithbasictypearguments ---------------------------- 0 (1 row) -- Adrian Klaver adrian.klaver@aklaver.com