* [pbs-devel] [PATCH proxmox-backup v2] close #3777: Add source information to backup logs
@ 2023-09-08 14:01 Gabriel Goller
2023-09-18 14:39 ` [pbs-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Goller @ 2023-09-08 14:01 UTC (permalink / raw)
To: pbs-devel
This will show the ip-address of the client creating
the backup in the logs. For example it will output:
"starting new backup on datastore 'test1' from ::ffff:192.168.1.192:
"host/test/2023-08-21T07:28:10Z"".
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
update v1:
- improved unwrapping of ip adress
src/api2/backup/mod.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/api2/backup/mod.rs b/src/api2/backup/mod.rs
index 652d5baa..18fad745 100644
--- a/src/api2/backup/mod.rs
+++ b/src/api2/backup/mod.rs
@@ -214,9 +214,12 @@ fn upgrade_to_backup_protocol(
env.debug = debug;
env.last_backup = last_backup;
+ let origin = match rpcenv.get_client_ip().map(|addr| addr.ip()) {
+ Some(ip) => format!(" from {ip}"),
+ None => "".into(),
+ };
env.log(format!(
- "starting new {} on datastore '{}': {:?}",
- worker_type, store, path
+ "starting new {worker_type} on datastore '{store}'{origin}: {path:?}",
));
let service =
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup v2] close #3777: Add source information to backup logs
2023-09-08 14:01 [pbs-devel] [PATCH proxmox-backup v2] close #3777: Add source information to backup logs Gabriel Goller
@ 2023-09-18 14:39 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-09-18 14:39 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Gabriel Goller
Am 08/09/2023 um 16:01 schrieb Gabriel Goller:
> This will show the ip-address of the client creating
> the backup in the logs. For example it will output:
> "starting new backup on datastore 'test1' from ::ffff:192.168.1.192:
> "host/test/2023-08-21T07:28:10Z"".
>
> Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
> ---
>
> update v1:
> - improved unwrapping of ip adress
>
> src/api2/backup/mod.rs | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-18 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 14:01 [pbs-devel] [PATCH proxmox-backup v2] close #3777: Add source information to backup logs Gabriel Goller
2023-09-18 14:39 ` [pbs-devel] applied: " Thomas Lamprecht
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