From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 0E7161FF391 for ; Wed, 12 Jun 2024 11:51:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 180E9CCED; Wed, 12 Jun 2024 11:51:38 +0200 (CEST) Message-ID: <65a13391-28a7-43e2-96ba-f81357f91279@proxmox.com> Date: Wed, 12 Jun 2024 11:51:04 +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> Content-Language: en-US In-Reply-To: <20240209141503.62402-1-f.ebner@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.059 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [restenvironment.pm] 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 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