Store log file in the same folder as config data
This commit is contained in:
@@ -89,9 +89,9 @@ Open the crontab file with `crontab -e`.
|
||||
|
||||
Add the following contents:
|
||||
```
|
||||
00 07 * * * /usr/bin/python3 /home/ubuntu/POCloud-Scraper/reports_xlsx.py advvfdipp --send
|
||||
01 07 * * * /usr/bin/python3 /home/ubuntu/POCloud-Scraper/reports_xlsx.py ipp --send
|
||||
02 07 * * * /usr/bin/python3 /home/ubuntu/POCloud-Scraper/reports_xlsx.py abbflow --send
|
||||
00 07 * * * /usr/bin/python3 /home/ubuntu/POCloud-Scraper/reports_xlsx.py advvfdipp --send --config-path /home/ubuntu/POCloud-Scraper --output-path /home/ubuntu/POCloud-Scraper/files
|
||||
01 07 * * * /usr/bin/python3 /home/ubuntu/POCloud-Scraper/reports_xlsx.py ipp --send --config-path /home/ubuntu/POCloud-Scraper --output-path /home/ubuntu/POCloud-Scraper/files
|
||||
02 07 * * * /usr/bin/python3 /home/ubuntu/POCloud-Scraper/reports_xlsx.py abbflow --send --config-path /home/ubuntu/POCloud-Scraper --output-path /home/ubuntu/POCloud-Scraper/files
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ def main(sendEmail=False):
|
||||
def setup_logger():
|
||||
"""Setup and return the logger module."""
|
||||
log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(funcName)s(%(lineno)d) %(message)s')
|
||||
logFile = './emailreports.log'.format(DEVICE_TYPE_NAME)
|
||||
logFile = '{}/emailreports.log'.format(CONFIG_PATH)
|
||||
my_handler = RotatingFileHandler(logFile, mode='a', maxBytes=500*1024, backupCount=2, encoding=None, delay=0)
|
||||
my_handler.setFormatter(log_formatter)
|
||||
my_handler.setLevel(logging.INFO)
|
||||
|
||||
Reference in New Issue
Block a user