public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Cc: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup] api: Outsource the logger initialization to the router
Date: Fri, 29 Sep 2023 13:09:15 +0200	[thread overview]
Message-ID: <b981c430-9b17-38b3-f054-b2d17d0e7a5c@proxmox.com> (raw)
In-Reply-To: <jafju2ed6q5kuktplrslu6jde3aznhovy6yc7cwdifzdsl6h3v@25okbn7av7yr>


On 9/29/23 11:49, Wolfgang Bumiller wrote:
> On Fri, Sep 29, 2023 at 11:35:06AM +0200, Dominik Csapak wrote:
>> [..]
> On the one hand `proxmox-router` is used for both the API daemons and by
> our schema-based CLI parser, and we already have `cli::init_cli_logger`
> in there.
> On the other hand, there's no guarantee that all daemons will use this
> crate, if they don't need any schema/CLI parsing, but then again this
> can still be initialized specially there...
>
> Basically, I don't specifically object to having a common helper for
> a "this is how our daemons usually do logging" type of deal, but it may
> still make more sense in proxmox-rest-server.
I agree, it does more sense in the proxmox-rest-server crate.
> Regardless of where we put it, for our log refactoring, we'd need this
> to return a logger instance, rather than actually setting the logger,
> because our API daemons will need a *custom* logger to deal with the
> workers, which in turn needs access to the logger created *here*.

Yeah, we can do that, we will just have to return the `syslog::BasicLogger`
and call `log::set_boxed_logger(..)` in the api/proxy `run()` function.

Should we also return the max_log_level somehow, maybe in a tupel?
Currently I am already setting it in the `init_syslog_logger` function
using log::set_max_loglevel(..)`.

> The custom logger would then definitely go into `proxmox-rest-server`,
> so the syslog portion may as well live there, depending on which we'd
> consider more "consistent" with the CLI portion being in
> `proxmox-router` - the CLI tools definitely won't want to pull in
> `proxmox-rest-server`, so moving the cli logger setup there doesn't make
> sense.




  parent reply	other threads:[~2023-09-29 11:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21 11:19 Gabriel Goller
2023-08-21 11:19 ` [pbs-devel] [PATCH proxmox] router: Added `init_syslog_logger()` function Gabriel Goller
2023-09-29  8:47 ` [pbs-devel] [PATCH proxmox-backup] api: Outsource the logger initialization to the router Gabriel Goller
2023-09-29  9:35 ` Dominik Csapak
2023-09-29  9:49   ` Wolfgang Bumiller
2023-09-29 10:23     ` Dominik Csapak
2023-09-29 11:09     ` Gabriel Goller [this message]
2023-09-29 11:46       ` Wolfgang Bumiller

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=b981c430-9b17-38b3-f054-b2d17d0e7a5c@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    --cc=w.bumiller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal