all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [RFC proxmox-backup 0/2] Tasklog rewrite with tracing
Date: Wed, 11 Oct 2023 16:01:00 +0200	[thread overview]
Message-ID: <20231011140102.273423-1-g.goller@proxmox.com> (raw)

Removed the task_log! (and friends task_warn!, task_debug!, etc.) macro
and introduced the `tracing` crate. We now initiate the tracing crate
using two Layers, first the syslog layer (using the `syslog` crate) and
the `file_layer`. The file_layer uses the original `FileLogger`.

To write to the task logs from the worker threads and tasks, we now
have a task_local logger (and warning counter) in the file_layer, which
will get instantiated when a task/thread is created. This means that
when we call `info!` or any other `tracing` log macros (with the "tasklog"
attribute), it will get the file_logger from TLS and write to the file.

Gabriel Goller (1):
  log: removed task_log! macro and moved to tracing

 Cargo.toml                       |  61 ++++---
 pbs-api-types/src/metrics.rs     |   1 -
 pbs-api-types/src/node.rs        |   3 +-
 pbs-datastore/Cargo.toml         |   1 +
 pbs-datastore/src/chunk_store.rs |  33 ++--
 pbs-datastore/src/datastore.rs   | 101 ++++++-----
 src/api2/admin/datastore.rs      |  29 +--
 src/api2/admin/metrics.rs        |   2 +-
 src/api2/config/acme.rs          |  23 ++-
 src/api2/config/datastore.rs     |  15 +-
 src/api2/node/apt.rs             |  13 +-
 src/api2/node/certificates.rs    |  69 +++----
 src/api2/node/disks/directory.rs |  16 +-
 src/api2/node/disks/mod.rs       |   6 +-
 src/api2/node/disks/zfs.rs       |  32 ++--
 src/api2/node/mod.rs             |  11 +-
 src/api2/pull.rs                 |  27 ++-
 src/api2/tape/backup.rs          |  82 ++++-----
 src/api2/tape/drive.rs           | 158 +++++++++--------
 src/api2/tape/restore.rs         | 296 ++++++++++++++++---------------
 src/backup/verify.rs             | 108 +++++------
 src/bin/proxmox-backup-api.rs    |  10 +-
 src/bin/proxmox-backup-proxy.rs  |  45 ++---
 src/server/gc_job.rs             |   9 +-
 src/server/prune_job.rs          |  31 ++--
 src/server/pull.rs               | 192 +++++++++-----------
 src/server/realm_sync_job.rs     |  37 ++--
 src/server/verify_job.rs         |  13 +-
 src/tape/drive/mod.rs            |  37 ++--
 src/tape/pool_writer/mod.rs      |  90 +++++-----
 tests/worker-task-abort.rs       |   9 +-
 31 files changed, 764 insertions(+), 796 deletions(-)

Gabriel Goller (1):
  proxmox-log: added tracing infra

 Cargo.toml                                    |   6 +
 proxmox-log/Cargo.toml                        |  23 ++++
 proxmox-log/debian/changelog                  |   5 +
 proxmox-log/debian/control                    |  53 +++++++++
 proxmox-log/debian/copyright                  |  18 +++
 proxmox-log/debian/debcargo.toml              |   7 ++
 proxmox-log/src/file_layer.rs                 |  89 +++++++++++++++
 .../src/file_logger.rs                        |   2 +-
 proxmox-log/src/lib.rs                        |  36 ++++++
 proxmox-log/src/syslog_layer.rs               |  78 +++++++++++++
 proxmox-rest-server/Cargo.toml                |   2 +
 proxmox-rest-server/src/api_config.rs         |   3 +-
 proxmox-rest-server/src/lib.rs                |   3 -
 proxmox-rest-server/src/rest.rs               |   4 +-
 proxmox-rest-server/src/worker_task.rs        | 108 ++++++++++--------
 proxmox-router/Cargo.toml                     |   2 +
 proxmox-sys/src/worker_task_context.rs        |  47 --------
 17 files changed, 382 insertions(+), 104 deletions(-)
 create mode 100644 proxmox-log/Cargo.toml
 create mode 100644 proxmox-log/debian/changelog
 create mode 100644 proxmox-log/debian/control
 create mode 100644 proxmox-log/debian/copyright
 create mode 100644 proxmox-log/debian/debcargo.toml
 create mode 100644 proxmox-log/src/file_layer.rs
 rename {proxmox-rest-server => proxmox-log}/src/file_logger.rs (98%)
 create mode 100644 proxmox-log/src/lib.rs
 create mode 100644 proxmox-log/src/syslog_layer.rs

-- 
2.39.2





             reply	other threads:[~2023-10-11 14:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 14:01 Gabriel Goller [this message]
2023-10-11 14:01 ` [pbs-devel] [RFC proxmox-backup 1/2] log: removed task_log! macro and moved to tracing Gabriel Goller
2023-10-11 14:01 ` [pbs-devel] [RFC proxmox 2/2] proxmox-log: added tracing infra Gabriel Goller
2023-10-13 12:36   ` Gabriel Goller
2023-10-18 13:26   ` Dominik Csapak
2023-10-23  8:56     ` Gabriel Goller
2023-10-23  9:11       ` Gabriel Goller
2023-10-18 13:12 ` [pbs-devel] [RFC proxmox-backup 0/2] Tasklog rewrite with tracing Dominik Csapak
2023-10-23  9:09   ` Gabriel Goller
2023-10-23  9:29     ` Dominik Csapak
2023-10-23 11:43       ` Gabriel Goller
2023-10-23 14:33       ` Thomas Lamprecht
2023-10-24 13:44         ` Gabriel Goller
2023-10-25 13:55           ` Gabriel Goller

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=20231011140102.273423-1-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pbs-devel@lists.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 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