Skip to content

Logging to file or rsyslog #5514

Answered by nahun
mntbighker asked this question in Q&A
Dec 22, 2020 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

This is what I use to send logs to syslog-ng

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'ntb': {
            'format': 'NetBox: level=%(levelname)s,logger=%(name)s,msg=%(message)s'
        }
    },
    'handlers': {
        'syslog': {
            'level': 'INFO',
            'class': 'logging.handlers.SysLogHandler',
            'address': '/dev/log',
            'facility': 'local7',
            'formatter': 'ntb'
        }
    },
    'loggers': {
        '': {
            'handlers': ['syslog'],
            'level': 'INFO'
        }
    }
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@mntbighker
Comment options

Comment options

You must be logged in to vote
1 reply
@mntbighker
Comment options

Answer selected by mntbighker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants