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

[develop] Adding jids in master & minion logs #48660

Merged
merged 17 commits into from Aug 3, 2018

Conversation

Projects
None yet
5 participants
@garethgreenaway
Copy link
Member

commented Jul 18, 2018

What does this PR do?

This change adds the optional ability to include the JIDs in the master & minion logs for all entries related to a particular Salt job.

What issues does this PR fix or reference?

#45282

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@garethgreenaway garethgreenaway requested a review from saltstack/team-core as a code owner Jul 18, 2018

@salt-jenkins salt-jenkins requested a review from saltstack/team-suse Jul 18, 2018

@isbm
Copy link
Contributor

left a comment

Unit Tests? 😉

@gtmanfred
Copy link
Contributor

left a comment

Nice, well done.

blind-review

@rallytime
Copy link
Contributor

left a comment

I have a very minor change request.

Otherwise, great idea using tornado's StackContext!

@@ -238,6 +238,19 @@ at the ``debug`` level, and sets a custom module to the ``all`` level:
'salt.modules': 'debug'
'salt.loader.saltmaster.ext.module.custom_module': 'all'
.. conf_log:: log_fmt_console

This comment has been minimized.

Copy link
@rallytime

rallytime Jul 20, 2018

Contributor

This should be log_fmt_jid

@rallytime rallytime added the Awesome label Jul 20, 2018

@rallytime rallytime requested a review from cachedout Jul 20, 2018

@garethgreenaway garethgreenaway force-pushed the garethgreenaway:jids_in_logs branch 2 times, most recently from 8ee602b to 96cc656 Jul 21, 2018

@garethgreenaway

This comment has been minimized.

Copy link
Member Author

commented Jul 27, 2018

Tests will pass under Python3 if logging is not disabled

➜ python ~/code/salt/tests/runtests.py -n integration.logging.test_jid_logging
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Python Version: 3.6.5 (default, Jul 27 2018, 13:22:44) [GCC 7.3.0]
 * Transplanting configuration files to '/tmp/salt-tests-tmpdir/config'
 * Current Directory: /home/gareth/code/salt
 * Test suite is running under PID 18747
 * Logging tests on /tmp/salt-runtests.log
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Max open files settings is too low (soft: 1024, hard: 4096) for running the tests
 * Trying to raise the limits to soft: 3072, hard: 4096
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Setting up Salt daemons to execute tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Starting salt-master ... STARTED!                                                                                                                                                                                                          
 * Starting salt-minion ... STARTED!                                                                                                                                                                                                          
 * Starting sub salt-minion ... STARTED!                                                                                                                                                                                                      
 * Starting syndic salt-master ... STARTED!                                                                                                                                                                                                   
 * Starting salt-syndic ... STARTED!                                                                                                                                                                                                          
==============================================================================================================================================================================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting integration.logging.test_jid_logging Tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.
----------------------------------------------------------------------
Ran 1 test in 0.272s

OK

===========================================================================================================  Overall Tests Report  ===========================================================================================================
***  No Problems Found While Running Tests  **************************************************************************************************************************************************************************************************
==============================================================================================================================================================================================================================================
OK (total=1, skipped=0, passed=1, failures=0, errors=0) 
===========================================================================================================  Overall Tests Report  ===========================================================================================================
@isbm

isbm approved these changes Jul 31, 2018

Copy link
Contributor

left a comment

👍

@rallytime

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2018

garethgreenaway added some commits Jul 5, 2018

Pop the jid out of extra then add it to the logrecord. Swap out the i…
…mport for logging to import the salt.log.setup to ensure that we're using the customized salt logging.
Introduce "log_fmt_jid" and ensure we are passing opts to the Request…
…Context so we have control the format of what the JID will look like in the logs.
Adding an integration test to test that JIDs will show up in the logs…
… if it is included in the log format string.

@garethgreenaway garethgreenaway force-pushed the garethgreenaway:jids_in_logs branch from 6d3d0df to c97e65e Jul 31, 2018

@rallytime rallytime added the Fluorine label Jul 31, 2018

@garethgreenaway

This comment has been minimized.

Copy link
Member Author

commented Aug 1, 2018

re-run all

@cachedout
Copy link
Collaborator

left a comment

This is extremely well-done. Hats off, @garethgreenaway

@rallytime rallytime merged commit 8c5b369 into saltstack:develop Aug 3, 2018

4 of 9 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
codeclimate 1 issue to fix
Details
jenkins/pr/lint The lint job has failed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has failed
Details
jenkins/pr/py2-centos-7 running py2-centos-7...
Details
WIP ready for review
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.