`logpath` option for pbm-agent via env var or command line

Description

Problem description

We cannot set a custom path for the log file or the log level. A customer prioritized the ability to set log path (in PMM agents and PBM agents) via a --log path options or better via the config file.

Solution proposition

It’ll be possible to start the PBM agent either with the command-line log option or with config, for example:

pbm-agent --mongodb-uri=mongodb://backupUser:test1234@192.168.56.96:27018/?authSource=admin --log-path=/tmp/pbm_log/test_command_line.log OR pbm-agent --config=/tmp/pbm.cfg

 

Command line options:

--log-path="/dev/stderr" path to file --log-json enable JSON output --log-level=debug minimal log level (options: "debug", "info", "warning", "error")

 

For a Kubernetes operator, environment variables could be used additionally.

 

Priorities of applying parameters:

  1. Command line parameters

  2. Environment variable

  3. Configuration option

Acceptance Criteria

  • Ability to configure log path and level via configuration file

  • Ability to override log path and log level via command line

  • Default setting should be applied - default log path and log level if nothing was specified

  • Easy automation is possible to easily setup a consistent log path configuration across all PBM agents

Environment

None

AFFECTED CS IDs

CS0042002

Activity

Show:

Boris Ilijic November 26, 2024 at 1:31 PM
Edited

We came to the following conclusions on the refinement meeting::

  • central configuration for logger (pbm log --file ...), which is present in the current implementation, will be removed, and that approach is abandoned (it’s not aligned with typical unix convention, see Sandras' comment above).

  • within this ticket, we’ll provide pbm-agent’s options/flags and env variables for: log path, log json, log level.

  • pbm-agent’s config support for logger will be part of: https://perconadev.atlassian.net/browse/PBM-1454

radoslaw.szulgo November 26, 2024 at 12:26 PM

Issue split into:

https://perconadev.atlassian.net/browse/PBM-1454#icft=PBM-1454

`logpath` option for pbm-agent via configuration file

Boris Ilijic November 26, 2024 at 10:29 AM

Yes, let’s discuss it together on the today’s meeting, and then I’ll write conclusions here.

radoslaw.szulgo November 26, 2024 at 10:23 AM

I agree, Sandra. can you please refine?

Jan Mynar March 28, 2024 at 12:56 PM

Flag On Flag added

Jan will clarify with Santo

Done

Details

Assignee

Reporter

Planned Version/s

Needs QA

Yes

Sprint

Fix versions

Priority

Smart Checklist

Created December 21, 2023 at 11:25 AM
Updated December 12, 2024 at 5:47 PM
Resolved December 3, 2024 at 9:55 AM

Flag notifications