working service
This commit is contained in:
parent
786b530dc1
commit
2fec436cbe
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
scratch.py
|
scratch.py
|
||||||
service.json
|
service.json
|
||||||
|
ticker-env
|
||||||
|
|
||||||
*~*
|
*~*
|
||||||
*#
|
*#
|
||||||
|
@ -7,6 +7,8 @@ ExecStart=/usr/bin/python3 /home/pi/ticker/main.py
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=PYTHONUNBUFFERED=1
|
Environment=PYTHONUNBUFFERED=1
|
||||||
|
User=pi
|
||||||
|
EnvironmentFile=/home/pi/ticker/ticker-env
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from ticker.ticker import Ticker
|
from ticker.ticker import Ticker
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
fmlogger = logging.getLogger('fmframework')
|
fmlogger = logging.getLogger('fmframework')
|
||||||
logger.setLevel('DEBUG')
|
logger.setLevel('DEBUG')
|
||||||
|
|
||||||
file_handler = logging.FileHandler("ticker.log")
|
file_handler = logging.FileHandler(f"{os.environ.get('TICKER_LOG_DIR', '')}ticker.log")
|
||||||
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(name)s - %(funcName)s - %(message)s'))
|
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(name)s - %(funcName)s - %(message)s'))
|
||||||
logger.addHandler(file_handler)
|
logger.addHandler(file_handler)
|
||||||
fmlogger.addHandler(file_handler)
|
fmlogger.addHandler(file_handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user