Browse Source

Added timestamp to log file

master
Rune Olsen 1 year ago
parent
commit
1b1539ece9
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      py-dyndns.py

+ 4
- 2
py-dyndns.py View File

@@ -6,6 +6,8 @@ import logging
import argparse
import requests
import os
from datetime import datetime

# Config stuff

filepath = os.path.dirname(os.path.abspath(__file__))
@@ -59,11 +61,11 @@ def runupdate():
if remoteIP4 != local_ip4:
response = updateip(local_ip4, value)
if '200' in response:
logging.info('Success! Domain %s updated with IP: %s (old IP: %s)', section,local_ip4,remoteIP4)
logging.info(str(datetime.now())+' - Success! Domain %s updated with IP: %s (old IP: %s)', section,local_ip4,remoteIP4)
else:
logging.error('Failure! '+response)
else:
logging.info('No need to update the IP! Local IP ('+local_ip4+') for '+section+' is the same as '
logging.info(str(datetime.now())+' - No need to update the IP! Local IP ('+local_ip4+') for '+section+' is the same as '
'Remote IP ('+remoteIP4+')')




Loading…
Cancel
Save