* [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog
@ 2024-02-09 14:15 Fiona Ebner
2024-06-12 9:51 ` Fiona Ebner
2024-11-11 18:41 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 4+ messages in thread
From: Fiona Ebner @ 2024-02-09 14:15 UTC (permalink / raw)
To: pve-devel
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}++;
--
2.39.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog
2024-02-09 14:15 [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog Fiona Ebner
@ 2024-06-12 9:51 ` Fiona Ebner
2024-09-11 11:46 ` Fiona Ebner
2024-11-11 18:41 ` [pve-devel] applied: " Thomas Lamprecht
1 sibling, 1 reply; 4+ messages in thread
From: Fiona Ebner @ 2024-06-12 9:51 UTC (permalink / raw)
To: 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 <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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog
2024-06-12 9:51 ` Fiona Ebner
@ 2024-09-11 11:46 ` Fiona Ebner
0 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2024-09-11 11:46 UTC (permalink / raw)
To: 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 <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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied: [PATCH v2 common] REST environment: warn helpers: also log messages to syslog
2024-02-09 14:15 [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog Fiona Ebner
2024-06-12 9:51 ` Fiona Ebner
@ 2024-11-11 18:41 ` Thomas Lamprecht
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-11-11 18:41 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
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(+)
>
>
Albeit I'm not 100% sure how this will work out, my gut is not always right,
and it still seems more than sensible enough to try, so:
applied, thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-11 18:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 14:15 [pve-devel] [PATCH v2 common] REST environment: warn helpers: also log messages to syslog Fiona Ebner
2024-06-12 9:51 ` Fiona Ebner
2024-09-11 11:46 ` Fiona Ebner
2024-11-11 18:41 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox