Skip to content

LOG_FILENAME should be configurable #96

Description

@JP95Git

With commit 663871a it is possible to change the barman config file. But the log file LOG_FILENAME is still fixed to /var/log/barman/barman-api.log.

Running pg-backup-api as a user with very strict priviliges I get this error:

[2025-09-15 16:20:05 +0200] [2155515] [INFO] Starting gunicorn 23.0.0
[2025-09-15 16:20:05 +0200] [2155515] [INFO] Listening at: http://0.0.0.0:7480 (2155515)
[2025-09-15 16:20:05 +0200] [2155515] [INFO] Using worker: sync
[2025-09-15 16:20:05 +0200] [2155516] [INFO] Booting worker with pid: 2155516
[2025-09-15 16:20:05 +0200] [2155516] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/lib64/python3.9/logging/config.py", line 564, in configure
    handler = self.configure_handler(handlers[name])
  File "/usr/lib64/python3.9/logging/config.py", line 745, in configure_handler
    result = factory(**kwargs)
  File "/usr/lib64/python3.9/logging/__init__.py", line 1146, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python3.9/logging/__init__.py", line 1175, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding,
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/barman/barman-api.log'

My workaround is to change the path in the sources:
find . -type f -name "*.py" -exec sed -i 's|/var/log/barman/barman-api.log|/my/path/to/barman-api.log|g' {} +
and compile it again:
python3 setup.py install

I used a venv of Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions