%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/lib/python2.7/site-packages/salt/log/handlers/
Upload File :
Create Path :
Current File : //proc/self/root/lib/python2.7/site-packages/salt/log/handlers/log4mongo_mod.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZddl	m
Z
ddlmZy ddl
mZmZeZWnek
r�eZnXdZd	�Zd
eje
fd��YZd�ZdS(
uK
    Log4Mongo Logging Handler
    =========================

    This module provides a logging handler for sending salt logs to MongoDB

    Configuration
    -------------

    In the salt configuration file (e.g. /etc/salt/{master,minion}):

    .. code-block:: yaml

        log4mongo_handler:
          host: mongodb_host
          port: 27017
          database_name: logs
          collection: salt_logs
          username: logging
          password: reindeerflotilla
          write_concern: 0
          log_level: warning


    Log Level
    .........

    If not set, the log_level will be set to the level defined in the global
    configuration file setting.

    .. admonition:: Inspiration

        This work was inspired by the Salt logging handlers for LogStash and
        Sentry and by the log4mongo Python implementation.
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tNewStyleClassMixIn(t
LOG_LEVELS(tMongoHandlertMongoFormatterumongocC@sts
tStS(N(t	HAS_MONGOtFalset__virtualname__(((sC/usr/lib/python2.7/site-packages/salt/log/handlers/log4mongo_mod.pyt__virtual__9stFormatterWithHostcB@seZd�ZRS(cC@s,t�}|j|�}tj�|d<|S(Nuhostname(Rtformattsockettgethostname(tselftrecordtmongoformattertdocument((sC/usr/lib/python2.7/site-packages/salt/log/handlers/log4mongo_mod.pyR
@s	(t__name__t
__module__R
(((sC/usr/lib/python2.7/site-packages/salt/log/handlers/log4mongo_mod.pyR?scc@s�d}|tkr�idd6dd6dd6dd6dd6dd6dd	6}i}x4tj|�D]#\}}t|j|�||<q_Wtt|jd
tjd
d��|d<td
t�|�}|VntVdS(Nulog4mongo_handleruhostuportu
database_nameu
collectionuusernameupassworduwu
write_concernu	log_leveluerrorulevelt	formatter(t__opts__Rt	iteritemstgetRRRR	(t
handler_idt
config_fieldstconfig_optst
config_opttarg_namethandler((sC/usr/lib/python2.7/site-packages/salt/log/handlers/log4mongo_mod.pytsetup_handlersGs,

	(t__doc__t
__future__RRRRtloggingtsalt.extRtsalt.log.mixinsRtsalt.log.setupRtlog4mongo.handlersRRtTrueRtImportErrorR	R
Rt	FormatterRR (((sC/usr/lib/python2.7/site-packages/salt/log/handlers/log4mongo_mod.pyt<module>$s


	

Zerion Mini Shell 1.0