Skip to content

Foremanct - Log levels for Foreman & Proxy#640

Merged
evgeni merged 2 commits into
theforeman:masterfrom
stejskalleos:ls/logging
Jul 15, 2026
Merged

Foremanct - Log levels for Foreman & Proxy#640
evgeni merged 2 commits into
theforeman:masterfrom
stejskalleos:ls/logging

Conversation

@stejskalleos

Copy link
Copy Markdown
Contributor

Why are you introducing these changes? (Problem description, related links)

To give users the option to change the log level of the services.

What changes are introduced in this pull request?

Three new deploy parameters:

  • --log-level Default log level for all services.
  • --foreman-log-level Log level for foreman.service
  • --foreman-proxy-log-level Log level for foreman-proxy.service

How to test this pull request

foremanctl deploy --initial-admin-password=changeme \
--add-feature foreman-proxy \
--tuning development \
--log-level=debug

or

foremanctl deploy --foreman-log-level=error --foreman-proxy-log-level=error

and then:

journalctl -f -u foreman.service
journalctl -f -u foreman-proxy.service

Notes

Resetting params won't work

./foremanctl deploy --reset-foreman-log-level --reset-foreman-proxy-log-level

Fixed in https://github.com/theforeman/obsah/pull/127/changes

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

Comment thread src/playbooks/_logging/metadata.obsah.yaml Outdated
Comment thread src/roles/foreman/tasks/main.yaml
Comment thread src/playbooks/_logging/metadata.obsah.yaml
Comment thread src/vars/logging.yml Outdated
env:
SEED_ORGANIZATION: "{{ foreman_initial_organization }}"
SEED_LOCATION: "{{ foreman_initial_location }}"
FOREMAN_LOGGING_LEVEL: "{{ foreman_log_level }}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not directly related to the PR here, but we have a set of env vars we pass to all foreman containers. time to consolidate them into a variable so we don't have to edit them in multuple places? same for secrets, I guess?

the pulp role has some prior work on this if you look for inspiration

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evgeni

evgeni commented Jul 10, 2026

Copy link
Copy Markdown
Member

I like this!

@evgeni

evgeni commented Jul 10, 2026

Copy link
Copy Markdown
Member

Memo to self about Valkey: need to pass --loglevel X on the CLI.
Possible values documented in https://github.com/valkey-io/valkey/blob/3886bee1ca595f0fafa576c409fc77871a1226c4/valkey.conf#L342-L349

@evgeni

evgeni commented Jul 10, 2026

Copy link
Copy Markdown
Member

pulp (according to https://pulpproject.org/pulpcore/docs/admin/reference/settings/#logging and https://docs.djangoproject.com/en/4.2/topics/logging/#loggers) will need some translation in the settings too

Comment thread docs/user/parameters.md
Comment on lines 112 to 113
| `--foreman-logging-layout` | | |
| `--foreman-logging-level` | | |
| `--foreman-logging-type` | | |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but I think I think we can say that layout and type will likely not be supported.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the author of this PR won't get to fix it quickly, I propose you track this as a separate work item

Comment thread docs/user/parameters.md
@@ -165,7 +179,6 @@ There are multiple use cases from the users perspective that dictate what parame
| `--foreman-proxy-content-enable-ostree` | | | |
| `--foreman-proxy-http` | | | |
| `--foreman-proxy-log` | | | |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above. This controls where the proxy logs to (stdout, syslog, journal). I think in a containerized world we won't make that configurable so move this to the Unmapped section?

@shubhamsg199

Copy link
Copy Markdown
Contributor

🍏 Tested with foremanctl-3.0.0.develop-2.20260713052924310495.pr640.79.g9b74dc0.el9.noarch

Scenarios tested:

  1. Set a log level for foreman service and verify its correctly set in the parameters file. Also verify the output in foreman journal
  2. Set a log level for foreman service and verify its correctly set in the parameters file. Also verify the output in foreman journal
  3. Set log level for foreman-proxy without enabling it and verify deployment succeeds
  4. Reset the log levels(tested with https://github.com/theforeman/obsah/pull/127/changes) and verify they are not present in parameters file

Automation PR: SatelliteQE/robottelo#22148

@evgeni evgeni merged commit c76aaaa into theforeman:master Jul 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants