mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-16 04:02:56 -06:00
Added path config to log filehandler.
This commit is contained in:
parent
6d9698c40c
commit
bff611ca67
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
"""Netbox to Zabbix sync script."""
|
"""Netbox to Zabbix sync script."""
|
||||||
|
|
||||||
from os import environ
|
from os import environ, path
|
||||||
import logging
|
import logging
|
||||||
import argparse
|
import argparse
|
||||||
from pynetbox import api
|
from pynetbox import api
|
||||||
@ -14,7 +14,7 @@ lgout = logging.StreamHandler()
|
|||||||
lgout.setFormatter(log_format)
|
lgout.setFormatter(log_format)
|
||||||
lgout.setLevel(logging.DEBUG)
|
lgout.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
lgfile = logging.FileHandler("sync.log")
|
lgfile = logging.FileHandler(path.join(path.dirname(path.realpath(__file__)), "sync.log"))
|
||||||
lgfile.setFormatter(log_format)
|
lgfile.setFormatter(log_format)
|
||||||
lgfile.setLevel(logging.DEBUG)
|
lgfile.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user