mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
parent
b1b6c8d416
commit
b5a92a5fc3
@ -493,7 +493,7 @@ def search(opts, returners, whitelist=None):
|
||||
)
|
||||
|
||||
|
||||
def log_handlers(opts):
|
||||
def log_handlers(opts, functions=None, grains=None):
|
||||
'''
|
||||
Returns the custom logging handler modules
|
||||
|
||||
@ -509,6 +509,7 @@ def log_handlers(opts):
|
||||
),
|
||||
opts,
|
||||
tag='log_handlers',
|
||||
pack={'__salt__': functions, '__grains__': grains}
|
||||
)
|
||||
return FilterDictWrapper(ret, '.setup_handlers')
|
||||
|
||||
|
@ -93,8 +93,6 @@ except ImportError:
|
||||
HAS_RAVEN = False
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
__grains__ = {}
|
||||
__salt__ = {}
|
||||
|
||||
# Define the module's virtual name
|
||||
__virtualname__ = 'sentry'
|
||||
@ -102,8 +100,6 @@ __virtualname__ = 'sentry'
|
||||
|
||||
def __virtual__():
|
||||
if HAS_RAVEN is True:
|
||||
__grains__ = salt.loader.grains(__opts__)
|
||||
__salt__ = salt.loader.minion_mods(__opts__)
|
||||
return __virtualname__
|
||||
return False
|
||||
|
||||
|
@ -678,7 +678,10 @@ def setup_extended_logging(opts):
|
||||
initial_handlers = logging.root.handlers[:]
|
||||
|
||||
# Load any additional logging handlers
|
||||
providers = salt.loader.log_handlers(opts)
|
||||
# Pack the handlers with exec modules and grains
|
||||
funcs = salt.loader.minion_mods(opts)
|
||||
grains = salt.loader.grains(opts)
|
||||
providers = salt.loader.log_handlers(opts, functions=funcs, grains=grains)
|
||||
|
||||
# Let's keep track of the new logging handlers so we can sync the stored
|
||||
# log records with them
|
||||
|
Loading…
Reference in New Issue
Block a user