Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The logging setup by utils.display only ever uses error/info log levels. #25761

Closed
alikins opened this issue Jun 15, 2017 · 2 comments
Closed
Assignees
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. c:utils/display support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@alikins
Copy link
Contributor

alikins commented Jun 15, 2017

SUMMARY

Any log records sent to the logger created in display only use error or info.
'warning' and 'debug' could be used for finer grained logs, especially if combined
with additional log handlers.

Additionally, the ansible specific verbosity levels could be mapped to custom log levels
('v', 'vvv', etc).

The additional verbosity levels ansible/display already use could be passed into display.display and/or its logger to allow finer grained log configuration.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

lib/ansible/utils/display.py

ANSIBLE VERSION
ansible 2.4.0 (devel 44687bb917) last updated 2017/06/15 13:12:13 (GMT -400)
  config file = None
  configured module search path = [u'/home/adrian/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/adrian/src/ansible/lib/ansible
  executable location = /home/adrian/src/ansible/bin/ansible
  python version = 2.7.13 (default, May 10 2017, 20:04:28) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]

CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug_report c:utils/display needs_triage Needs a first human triage before being processed. labels Jun 15, 2017
@alikins alikins mentioned this issue Jun 15, 2017
@nitzmahone nitzmahone removed the needs_triage Needs a first human triage before being processed. label Jun 15, 2017
@ansibot ansibot added the support:core This issue/PR relates to code supported by the Ansible Engineering Team. label Jun 29, 2017
@ssbarnea
Copy link
Member

I think that Ansible should be gradually refactored to use the standard Python logging method instead of the Display() facility as that one provides everything needed for extending logging. Callback plugins should work more like Logging handlers.

Current logging design (implementation) is crippled quite well, harcoded logging levels, impossible to define different logging levels for each destination and so on. My impression that that the Display() class is the root of all evil on Ansible logging issues... just one example: it does format the message before knowing where the message will be sent.... is like HTML before CSS was introduced ;)

gerrit-ovirt-org pushed a commit to oVirt/ovirt-hosted-engine-setup that referenced this issue Jan 10, 2018
make ansible-playbook logging via ANSIBLE_LOG_PATH
env variable.
Unfortunately we cannot use a single ansible.cfg file
in our playbooks directory due to
ansible/ansible#11175
We cannot neither use plain ansible logger facility
since it's just based on utils/display.py
See:
ansible/ansible#25761 (comment)

Current log format is really poor, we have more details
in the extra dicitonay but we are not writing it.
There is no filtering at all for sensitive information.


Change-Id: Idc9eb76ea295462e51ca32fd376946c15d44ef56
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 1, 2018
bcoca added a commit to bcoca/ansible that referenced this issue May 10, 2019
jeevers pushed a commit to jeevers/ansible that referenced this issue May 24, 2019
* some logging fixes

  fixes ansible#25757, ansible#25758, ansible#25761
  alternative to ansible#41859 and ansible#25765

* better color handling, courtesy of alikins
@bcoca
Copy link
Member

bcoca commented May 24, 2019

closed via #56311

@bcoca bcoca closed this as completed May 24, 2019
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. c:utils/display support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

5 participants