working service
This commit is contained in:
parent
786b530dc1
commit
2fec436cbe
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
scratch.py
|
||||
service.json
|
||||
ticker-env
|
||||
|
||||
*~*
|
||||
*#
|
||||
|
@ -7,6 +7,8 @@ ExecStart=/usr/bin/python3 /home/pi/ticker/main.py
|
||||
|
||||
[Service]
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
User=pi
|
||||
EnvironmentFile=/home/pi/ticker/ticker-env
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
|
@ -1,11 +1,12 @@
|
||||
import logging
|
||||
import os
|
||||
from ticker.ticker import Ticker
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
fmlogger = logging.getLogger('fmframework')
|
||||
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'))
|
||||
logger.addHandler(file_handler)
|
||||
fmlogger.addHandler(file_handler)
|
||||
|
Loading…
Reference in New Issue
Block a user