From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog
Date: Wed, 11 Sep 2024 13:46:19 +0200 [thread overview]
Message-ID: <a21c3a9d-db8d-4309-aecc-5940528c475b@proxmox.com> (raw)
In-Reply-To: <65a13391-28a7-43e2-96ba-f81357f91279@proxmox.com>
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 <f.weber@proxmox.com>
>> Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
>> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
>> ---
>>
>> 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
next prev parent reply other threads:[~2024-09-11 11:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 14:15 Fiona Ebner
2024-06-12 9:51 ` Fiona Ebner
2024-09-11 11:46 ` Fiona Ebner [this message]
2024-11-11 18:41 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a21c3a9d-db8d-4309-aecc-5940528c475b@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal