From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2EEEDF459 for ; Fri, 29 Sep 2023 11:49:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 06EA51EA28 for ; Fri, 29 Sep 2023 11:49:26 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 29 Sep 2023 11:49:24 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D458A48E2F for ; Fri, 29 Sep 2023 11:49:23 +0200 (CEST) Date: Fri, 29 Sep 2023 11:49:22 +0200 From: Wolfgang Bumiller To: Dominik Csapak Cc: Proxmox Backup Server development discussion , Gabriel Goller , Thomas Lamprecht Message-ID: References: <20230821111938.110298-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.099 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup] api: Outsource the logger initialization to the router X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2023 09:49:56 -0000 On Fri, Sep 29, 2023 at 11:35:06AM +0200, Dominik Csapak wrote: > high level comment: > > is proxmox-router really the right place for this? > > IMHO where we want to log to should be decided by each binary/daemon/utility etc. and > not in the crate responsible for routing api requests? > > It would at least be better if it would be it's own crate (e.g. proxmox-log ?) > > I just say this because if we want to rework the logging from workers (which > live in proxmox-rest-server) this could complicate things > (though i did not spend too much time thinking what the possible issues could be) > > whats your opinion on that @wolfgang, @thomas? 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. 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*. 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.