From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id F05691FF164 for ; Wed, 11 Sep 2024 13:46:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 11385CDE9; Wed, 11 Sep 2024 13:46:53 +0200 (CEST) Message-ID: Date: Wed, 11 Sep 2024 13:46:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Fiona Ebner To: pve-devel@lists.proxmox.com References: <20240209141503.62402-1-f.ebner@proxmox.com> <65a13391-28a7-43e2-96ba-f81357f91279@proxmox.com> Content-Language: en-US In-Reply-To: <65a13391-28a7-43e2-96ba-f81357f91279@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.057 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Ping Am 12.06.24 um 11:51 schrieb Fiona Ebner: > Ping > > Am 09.02.24 um 15:15 schrieb Fiona Ebner: >> for better visibility. When not in a task, warnings from these helpers >> are only logged to STDERR, which is particularly unhelpful in case of >> daemons. This is the main motivation behind this change. >> >> For tasks, warnings from these helpers are already more visible on the >> UI side, but when looking at the syslog, one can only see the warning >> count from the task right now, not the actual messages. This is >> another reason in favor of the change. >> >> Reported-by: Friedrich Weber >> Suggested-by: Thomas Lamprecht >> Signed-off-by: Fiona Ebner >> --- >> >> Changes in v2: >> * Go with the approach suggested by Thomas. >> >> src/PVE/RESTEnvironment.pm | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm >> index 191c6eb..bfde7e6 100644 >> --- a/src/PVE/RESTEnvironment.pm >> +++ b/src/PVE/RESTEnvironment.pm >> @@ -723,6 +723,7 @@ sub log_warn { >> $rest_env->warn($message); >> } else { >> chomp($message); >> + syslog('warning', "%s", $message); >> print STDERR "WARN: $message\n"; >> } >> } >> @@ -732,6 +733,7 @@ sub warn { >> >> chomp($message); >> >> + syslog('warning', "%s", $message); >> print STDERR "WARN: $message\n"; >> >> $self->{warning_count}++; > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel