Skip to content

CLI: Reduce logging output in production environments #3370

Description

@sermayoral

1. What is not working as documented?

photoprism backup CLI thows a new info message in 2023.05 version which appears even when you set the log level to warning

2. How can we reproduce it?

In the CLI, execute the following command:

docker exec photoprism photoprism -l warning backup -i -f

3. What behavior do you expect?

Do not see info errors

4. What could be the cause of your problem?

A new message has been created using a different logger, or using an inappropriate log level

5. Can you provide us with example files for testing, error logs, or screenshots?

An execution without specifying the log level (default is info) returns the following messages, that is right:

docker exec photoprism photoprism  backup -i -f
time="2023-05-04T21:03:31Z" level=info msg="config: plus extension loaded [1.976566ms]"
time="2023-05-04T21:03:31Z" level=warning msg="replacing existing backup"
time="2023-05-04T21:03:31Z" level=info msg="writing backup to /photoprism/storage/backup/mysql/2023-05-04.sql"
time="2023-05-04T21:03:34Z" level=info msg="completed in 3.441416258s"

An execution specifying the log level to warning returns the following messages, that is wrong:

docker exec photoprism photoprism -l warning backup -i -f
time="2023-05-04T21:02:49Z" level=info msg="config: plus extension loaded [2.863629ms]"
time="2023-05-04T21:02:49Z" level=warning msg="replacing existing backup"

As you can see, now it doesn't show any info message except the "config: plus extension loaded" message, which is info and should NOT appear. The last message is correct, because it has warning level.

6. Which software versions do you use?

(a) PhotoPrism ARM64 Build 230504-cbf48798c

(b) MariaDB 10.11

(c) Debian Bullseye 64 bits.

(d) Browser Types: N/A

(e) Ad Blockers; N/A

7. On what kind of device is PhotoPrism installed?

Indifferent

8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?

Indifferent

Metadata

Metadata

Labels

releasedAvailable in a stable release

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions