Skip to content

Conversation

@ehelms
Copy link
Member

@ehelms ehelms commented May 15, 2025

This is the set of parameters from our docs around logging that are mentioned. I'm not 100% on whether we should include all of these so consider this a conversation starter.

This also raises a question -- what's the best strategy to test these kind of parameters? These take an input, change a settings file and then do have an affect on the log output.


{% if candlepin_loggers %}
{% for logger, log_level in candlepin_loggers.items() %}
log4j.logger.{{ logger }}= {{ log_level }}
Copy link
Member

Choose a reason for hiding this comment

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

No idea if it matters

Suggested change
log4j.logger.{{ logger }}= {{ log_level }}
log4j.logger.{{ logger }}={{ log_level }}

- json
foreman_loggers:
help: Enable specific loggers for debugging Foreman.
candlepin_loggers:
Copy link
Member

Choose a reason for hiding this comment

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

Can we somehow tell obsah this is a dict? In kafo you can specify --candlepin-loggers logger1:value1 --candlepin-loggers logger2:value2 and that results in a single hash with 2 keys.

Same above for foreman_loggers

Copy link
Member Author

Choose a reason for hiding this comment

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

I wondered the same thing. And wanted to see what @evgeni thought here on that as a type.

Copy link
Member

Choose a reason for hiding this comment

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

What's the end data structure you expect here?

candlepin_loggers:
  logger1: value1
  logger2: value2

That?

With "regular ansible", you'd just pass that as JSON, so --candlepin-loggers '{"logger1":"value1","logger2":"value2"}'. Yes, not strictly userfriendly, I know.

Kafo (judging by Ewouds comment) does allow multiple params that then get joined to one big dict?

I am sure we can implement that, just not sure it's an actual improvement for the user (I guess for the "one entry case, the syntax is nicer, but once you have more… idk)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think JSON is fine for now.

@ehelms ehelms force-pushed the add-logging-parameters branch from 53f7bc8 to 59947cf Compare May 16, 2025 12:34
Signed-off-by: Eric D. Helms <ericdhelms@gmail.com>
@ehelms ehelms force-pushed the add-logging-parameters branch from 59947cf to ec78402 Compare June 3, 2025 12:46
pulp_database_password:
help: Password for the Pulp database.
foreman_logging_level:
help: Set the log level for Foreman.
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Should we mention here in the help the default value, or is it enough to have it defined in the src/roles/foreman/defaults/main.yaml

- info
- debug
foreman_loggers:
help: Enable specific loggers for debugging Foreman.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we list the choices the same way as we do for the foreman_logging_level?

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.

4 participants