From d73964ea3c752b1a46a705ef39319e1161c9be9d Mon Sep 17 00:00:00 2001 From: Justin Findlay Date: Tue, 28 Jul 2015 15:54:10 -0600 Subject: [PATCH 1/2] add console_log_fmt color documentation --- conf/cloud | 2 ++ conf/master | 2 ++ conf/minion | 2 ++ doc/ref/configuration/master.rst | 27 ++++++++++++++++++--------- doc/ref/configuration/minion.rst | 31 +++++++++++++++++++------------ 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/conf/cloud b/conf/cloud index 3855eda7f5..9f42d5a2f8 100644 --- a/conf/cloud +++ b/conf/cloud @@ -65,7 +65,9 @@ # the coloring of the messages, these color formatters also include padding as # well. Color LogRecord attributes are only available for console logging. # +#log_fmt_console: '%(colorlevel)s %(colormsg)s' #log_fmt_console: '[%(levelname)-8s] %(message)s' +# #log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s' diff --git a/conf/master b/conf/master index 873c9cced9..2d52fab9ce 100644 --- a/conf/master +++ b/conf/master @@ -696,7 +696,9 @@ # the coloring of the messages, these color formatters also include padding as # well. Color LogRecord attributes are only available for console logging. # +#log_fmt_console: '%(colorlevel)s %(colormsg)s' #log_fmt_console: '[%(levelname)-8s] %(message)s' +# #log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s' # This can be used to control logging levels more specificically. This diff --git a/conf/minion b/conf/minion index 4b90808a10..1289cb7479 100644 --- a/conf/minion +++ b/conf/minion @@ -539,7 +539,9 @@ # the coloring of the messages, these color formatters also include padding as # well. Color LogRecord attributes are only available for console logging. # +#log_fmt_console: '%(colorlevel)s %(colormsg)s' #log_fmt_console: '[%(levelname)-8s] %(message)s' +# #log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s' # This can be used to control logging levels more specificically. This diff --git a/doc/ref/configuration/master.rst b/doc/ref/configuration/master.rst index 67ef482f1d..1763a7f923 100644 --- a/doc/ref/configuration/master.rst +++ b/doc/ref/configuration/master.rst @@ -2452,7 +2452,6 @@ Examples: log_file: udp://loghost:10514 - .. conf_master:: log_level ``log_level`` @@ -2467,8 +2466,6 @@ The level of messages to send to the console. See also :conf_log:`log_level`. log_level: warning - - .. conf_master:: log_level_logfile ``log_level_logfile`` @@ -2485,7 +2482,6 @@ it will inherit the level set by :conf_log:`log_level` option. log_level_logfile: warning - .. conf_master:: log_datefmt ``log_datefmt`` @@ -2501,8 +2497,6 @@ The date and time format used in console log messages. See also log_datefmt: '%H:%M:%S' - - .. conf_master:: log_datefmt_logfile ``log_datefmt_logfile`` @@ -2518,7 +2512,6 @@ The date and time format used in log file messages. See also log_datefmt_logfile: '%Y-%m-%d %H:%M:%S' - .. conf_master:: log_fmt_console ``log_fmt_console`` @@ -2529,12 +2522,29 @@ Default: ``[%(levelname)-8s] %(message)s`` The format of the console logging messages. See also :conf_log:`log_fmt_console`. +.. note:: + Log colors are enabled in ``log_fmt_console`` rather than the + :conf_master:`color` config since the logging system is loaded before the + master config. + + Console log colors are specified by these additional formatters: + + %(colorlevel)s + %(colorname)s + %(colorprocess)s + %(colormsg)s + + Since it is desirable to include the surrounding brackets, '[' and ']', in + the coloring of the messages, these color formatters also include padding + as well. Color LogRecord attributes are only available for console + logging. + .. code-block:: yaml + log_fmt_console: '%(colorlevel)s %(colormsg)s' log_fmt_console: '[%(levelname)-8s] %(message)s' - .. conf_master:: log_fmt_logfile ``log_fmt_logfile`` @@ -2550,7 +2560,6 @@ The format of the log file logging messages. See also log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s' - .. conf_master:: log_granular_levels ``log_granular_levels`` diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index 7e0ef0fa49..48132a82fd 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -145,7 +145,7 @@ the master hostname if name resolution fails. Defaults to 30 seconds. Set to zero if the minion should shutdown and not retry. .. code-block:: yaml - + retry_dns: 30 .. conf_minion:: master_port @@ -994,7 +994,6 @@ Examples: log_file: udp://loghost:10514 - .. conf_minion:: log_level ``log_level`` @@ -1009,8 +1008,6 @@ The level of messages to send to the console. See also :conf_log:`log_level`. log_level: warning - - .. conf_minion:: log_level_logfile ``log_level_logfile`` @@ -1027,7 +1024,6 @@ it will inherit the level set by :conf_log:`log_level` option. log_level_logfile: warning - .. conf_minion:: log_datefmt ``log_datefmt`` @@ -1043,8 +1039,6 @@ The date and time format used in console log messages. See also log_datefmt: '%H:%M:%S' - - .. conf_minion:: log_datefmt_logfile ``log_datefmt_logfile`` @@ -1060,7 +1054,6 @@ The date and time format used in log file messages. See also log_datefmt_logfile: '%Y-%m-%d %H:%M:%S' - .. conf_minion:: log_fmt_console ``log_fmt_console`` @@ -1071,12 +1064,29 @@ Default: ``[%(levelname)-8s] %(message)s`` The format of the console logging messages. See also :conf_log:`log_fmt_console`. +.. note:: + Log colors are enabled in ``log_fmt_console`` rather than the + :conf_minion:`color` config since the logging system is loaded before the + minion config. + + Console log colors are specified by these additional formatters: + + %(colorlevel)s + %(colorname)s + %(colorprocess)s + %(colormsg)s + + Since it is desirable to include the surrounding brackets, '[' and ']', in + the coloring of the messages, these color formatters also include padding + as well. Color LogRecord attributes are only available for console + logging. + .. code-block:: yaml + log_fmt_console: '%(colorlevel)s %(colormsg)s' log_fmt_console: '[%(levelname)-8s] %(message)s' - .. conf_minion:: log_fmt_logfile ``log_fmt_logfile`` @@ -1092,7 +1102,6 @@ The format of the log file logging messages. See also log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s' - .. conf_minion:: log_granular_levels ``log_granular_levels`` @@ -1104,7 +1113,6 @@ This can be used to control logging levels more specifically. See also :conf_log:`log_granular_levels`. - .. conf_minion:: failhard ``failhard`` @@ -1116,7 +1124,6 @@ Set the global failhard flag, this informs all states to stop running states at the moment a single state fails - .. code-block:: yaml failhard: False From cd9a48510fa7ccbd44624ce9595f54215718e058 Mon Sep 17 00:00:00 2001 From: Justin Findlay Date: Tue, 28 Jul 2015 16:03:08 -0600 Subject: [PATCH 2/2] document state_output_diff and sudo_user configs --- salt/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/config.py b/salt/config.py index 372f1284bb..c6a75d0db2 100644 --- a/salt/config.py +++ b/salt/config.py @@ -306,6 +306,9 @@ VALID_OPTS = { # Specify the format for state outputs. See highstate outputter for additional details. 'state_output': str, + # Tells the highstate outputter to only report diffs of states that changed + 'state_output_diff': bool, + # When true, states run in the order defined in an SLS file, unless requisites re-order them 'state_auto_order': bool, @@ -699,6 +702,7 @@ VALID_OPTS = { # Used by salt-api for master requests timeout 'rest_timeout': int, + # If set, all minion exec module actions will be rerouted through sudo as this user 'sudo_user': str, } @@ -814,6 +818,7 @@ DEFAULT_MINION_OPTS = { 'cython_enable': False, 'state_verbose': True, 'state_output': 'full', + 'state_output_diff': False, 'state_auto_order': True, 'state_events': False, 'state_aggregate': False, @@ -1017,6 +1022,7 @@ DEFAULT_MASTER_OPTS = { 'serial': 'msgpack', 'state_verbose': True, 'state_output': 'full', + 'state_output_diff': False, 'state_auto_order': True, 'state_events': False, 'state_aggregate': False,