-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
No logging in file, when using Ara #41838
Comments
Files identified in the description: If these files are inaccurate, please update the |
cc @dmsimard |
@sivel thanks for the ping. @arjandekker this is quite a strange bug. I'll try to see if I can figure it out, thanks for reporting it ! |
I have narrowed down the issue to the logging configuration between Ansible and ARA conflicting. We landed a logging configuration refactor in the latest version of ARA (0.15.0). For what it's worth, the reproducer that I've used: https://gist.github.com/dmsimard/e3716a1d6f1e97e787aeb4e016d0fd6a As such, I don't think this is an Ansible bug but there might be a possible improvement. I don't know yet, I'll need to spend a bit more time on this. |
An issue reported to upstream Ansible [1] highlighted that it was fairly easy for the logging configurations of Ansible and ARA to conflict with each other. This commit makes it so we no longer set the root logger -- we don't need to since we're not expecting orphaned loggers which would inherit from the root configuration. It also makes it so we don't disable existing loggers which would prevent other software from being able to log properly. And finally, it prefixes the names of the handlers and formatters by "ara_" in order to prevent clashing with other software. [1]: ansible/ansible#41838 Change-Id: Iecc3324cc10a767b607d3055d6b93a12b9ae87ee
The logging configuration provided by ansible.utils.display was not namespaced which could cause conflicts with other python software running with Ansible such as plugins, modules, etc. This patch is effectively no-op in the sense that it keeps the exact same formatting and configuration but will prevent conflicts from happening. It also makes it easier to customize the logging configuration in the future if we need to or would like to expose a way for users to provide their own configuration. Fixes: ansible#41838 Fixes: ansible#25757 Fixes: ansible#25759
@arjandekker Are you still facing this issue? needs_info |
@arjandekker This issue is waiting for your response. Please respond or the issue will be closed. |
@arjandekker You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information. |
SUMMARY
We are using Ansible and ARA together. When we use Ansible 2.3.2 we are able to log to a file and send the log to a remote ARA server. This way we have a nice output of our Ansible runs and the details are in the logfile. But with version 2.5.5 the logging to ARA works fine, but the logfile is empty. When we remove the ARA callback plugin directory from the ansible.cfg file (remove from callback_plugins) the logging is working again, but of course ARA isn't. It doesn't matter if we use ANSIBLE_LOG_PATH or log_path (inside ansible.cfg).
ISSUE TYPE
COMPONENT NAME
log
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
RHEL7
pip install ansible
pip install ara
STEPS TO REPRODUCE
install Ansible like this, pip install ansible
install ARA like this, pip install ara
Use a remote ARA server, in ansible.cfg:
Specify the Ansible plugin for ARA, in ansible.cfg:
Change the log_path in ansible.cfg:
Run a playbook and check the logfile. It should be empty.
EXPECTED RESULTS
Logging to both ARA and the logfile
ACTUAL RESULTS
Logging in ARA works fine, but the logfile is empty.
The text was updated successfully, but these errors were encountered: