mirror of
https://git.proxmox.com/git/pve-common
synced 2025-04-28 17:07:50 +00:00
REST environment: warn helpers: also log messages to syslog
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>
This commit is contained in:
parent
d0dd3f25dc
commit
176d4bcb63
@ -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}++;
|
||||
|
Loading…
Reference in New Issue
Block a user