all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH proxmox-datacenter-manager] api: priv-api: admin-cli: use new logger builder
@ 2025-04-11 11:32 Lukas Wagner
  2025-04-11 11:39 ` Gabriel Goller
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Wagner @ 2025-04-11 11:32 UTC (permalink / raw)
  To: pdm-devel

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---

Notes:
    The Logger::tasklog_pbs is actually not specific to PBS but should be
    used for anything that uses WorkerTasks with a LogContext, as far as I
    can tell. We might want to rename it at some point.

 cli/admin/src/main.rs                               | 5 ++++-
 server/src/bin/proxmox-datacenter-api/main.rs       | 6 +++++-
 server/src/bin/proxmox-datacenter-privileged-api.rs | 5 ++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/cli/admin/src/main.rs b/cli/admin/src/main.rs
index 5fa9116b..91b93f3c 100644
--- a/cli/admin/src/main.rs
+++ b/cli/admin/src/main.rs
@@ -4,7 +4,10 @@ mod remotes;
 
 fn main() {
     //pbs_tools::setup_libc_malloc_opts(); // TODO: move from PBS to proxmox-sys and uncomment
-    proxmox_log::init_cli_logger("PDM_LOG", proxmox_log::LevelFilter::INFO)
+
+    proxmox_log::Logger::from_env("PDM_LOG", proxmox_log::LevelFilter::INFO)
+        .stderr()
+        .init()
         .expect("failed to set up logger");
 
     server::context::init().expect("could not set up server context");
diff --git a/server/src/bin/proxmox-datacenter-api/main.rs b/server/src/bin/proxmox-datacenter-api/main.rs
index 25852c8c..771fe45f 100644
--- a/server/src/bin/proxmox-datacenter-api/main.rs
+++ b/server/src/bin/proxmox-datacenter-api/main.rs
@@ -46,7 +46,11 @@ fn main() -> Result<(), Error> {
     server::env::sanitize_environment_vars();
 
     let debug = std::env::var("PROXMOX_DEBUG").is_ok();
-    proxmox_log::init_logger("PROXMOX_DEBUG", LevelFilter::INFO)?;
+
+    proxmox_log::Logger::from_env("PROXMOX_DEBUG", LevelFilter::INFO)
+        .journald_on_no_workertask()
+        .tasklog_pbs()
+        .init()?;
 
     if std::env::args().nth(1).is_some() {
         bail!("unexpected command line parameters");
diff --git a/server/src/bin/proxmox-datacenter-privileged-api.rs b/server/src/bin/proxmox-datacenter-privileged-api.rs
index 0e23a5f1..1f8a947c 100644
--- a/server/src/bin/proxmox-datacenter-privileged-api.rs
+++ b/server/src/bin/proxmox-datacenter-privileged-api.rs
@@ -23,7 +23,10 @@ fn main() -> Result<(), Error> {
 
     server::env::sanitize_environment_vars();
 
-    proxmox_log::init_logger("PROXMOX_DEBUG", LevelFilter::INFO)?;
+    proxmox_log::Logger::from_env("PROXMOX_DEBUG", LevelFilter::INFO)
+        .journald_on_no_workertask()
+        .tasklog_pbs()
+        .init()?;
 
     create_directories()?;
 
-- 
2.39.5



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pdm-devel] [PATCH proxmox-datacenter-manager] api: priv-api: admin-cli: use new logger builder
  2025-04-11 11:32 [pdm-devel] [PATCH proxmox-datacenter-manager] api: priv-api: admin-cli: use new logger builder Lukas Wagner
@ 2025-04-11 11:39 ` Gabriel Goller
  2025-04-11 12:12   ` [pdm-devel] superseded: " Lukas Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Goller @ 2025-04-11 11:39 UTC (permalink / raw)
  To: Lukas Wagner; +Cc: pdm-devel

On 11.04.2025 13:32, Lukas Wagner wrote:
>Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
>---
>
>Notes:
>    The Logger::tasklog_pbs is actually not specific to PBS but should be
>    used for anything that uses WorkerTasks with a LogContext, as far as I
>    can tell. We might want to rename it at some point.

Maybe we could put the first sentence here inside the commit message?

Otherwise LGTM!

Consider:
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>

> [snip]


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pdm-devel] superseded: [PATCH proxmox-datacenter-manager] api: priv-api: admin-cli: use new logger builder
  2025-04-11 11:39 ` Gabriel Goller
@ 2025-04-11 12:12   ` Lukas Wagner
  0 siblings, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-04-11 12:12 UTC (permalink / raw)
  To: pdm-devel, Gabriel Goller



On  2025-04-11 13:39, Gabriel Goller wrote:
> On 11.04.2025 13:32, Lukas Wagner wrote:
>> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
>> ---
>>
>> Notes:
>>    The Logger::tasklog_pbs is actually not specific to PBS but should be
>>    used for anything that uses WorkerTasks with a LogContext, as far as I
>>    can tell. We might want to rename it at some point.
> 
> Maybe we could put the first sentence here inside the commit message?
> 
> Otherwise LGTM!
> 
> Consider:
> Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
> 
>> [snip]

Good point actually, sent a v2 with the amended commit message, included your
R-b along the way.

Superseded-by: https://lore.proxmox.com/all/20250411121028.265555-1-l.wagner@proxmox.com/T/#u

-- 
- Lukas



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-11 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-11 11:32 [pdm-devel] [PATCH proxmox-datacenter-manager] api: priv-api: admin-cli: use new logger builder Lukas Wagner
2025-04-11 11:39 ` Gabriel Goller
2025-04-11 12:12   ` [pdm-devel] superseded: " Lukas Wagner

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