commit
38e4d9a72f
|
@ -40,8 +40,11 @@ msdrive_client_id: '6902b111-a9d6-461f-bd8a-83dafee3da66'
|
|||
msdrive_client_secret: 'add secret in .autocat3 or /etc/autocat3.conf files'
|
||||
|
||||
log.screen: False
|
||||
log.error_file: CherryPyApp.install_dir + '/log/error.log'
|
||||
log.access_file: CherryPyApp.install_dir + '/log/access.log'
|
||||
log.error_file: ''
|
||||
log.access_file: ''
|
||||
|
||||
logger.error_file: '/var/lib/autocat/log/error.log'
|
||||
logger.access_file: '/var/lib/autocat/log/access.log'
|
||||
log.rot_max_bytes: 104857600
|
||||
log.rot_backup_count: 2
|
||||
tools.log_headers.on: False
|
||||
|
|
|
@ -98,29 +98,29 @@ def main():
|
|||
pass
|
||||
|
||||
# Rotating Logs
|
||||
#
|
||||
|
||||
# read the log file locations from config file.
|
||||
error_file = cherrypy.config.get('log.error_file', 'error.log')
|
||||
access_file = cherrypy.config.get('log.error_file', 'access.log')
|
||||
|
||||
# turn off cp built-in logging
|
||||
cherrypy.log.error_file = ""
|
||||
cherrypy.log.access_file = ""
|
||||
# CherryPy will already open log files if present in config
|
||||
error_file = access_file = ''
|
||||
# read the logger file locations from config file.
|
||||
if not cherrypy.log.error_file:
|
||||
error_file = cherrypy.config.get('logger.error_file', '')
|
||||
if not cherrypy.log.access_file:
|
||||
access_file = cherrypy.config.get('logger.access_file', '')
|
||||
|
||||
# set up python logging
|
||||
max_bytes = getattr(cherrypy.log, "rot_max_bytes", 100 * 1024 * 1024)
|
||||
backup_count = getattr(cherrypy.log, "rot_backup_count", 2)
|
||||
|
||||
h = logging.handlers.RotatingFileHandler(error_file, 'a', max_bytes, backup_count, 'utf-8')
|
||||
h.setLevel(logging.INFO)
|
||||
h.setFormatter(cherrypy._cplogging.logfmt)
|
||||
cherrypy.log.error_log.addHandler(h)
|
||||
if error_file:
|
||||
h = logging.handlers.RotatingFileHandler(error_file, 'a', max_bytes, backup_count, 'utf-8')
|
||||
h.setLevel(logging.INFO)
|
||||
h.setFormatter(cherrypy._cplogging.logfmt)
|
||||
cherrypy.log.error_log.addHandler(h)
|
||||
|
||||
h = logging.handlers.RotatingFileHandler(access_file, 'a', max_bytes, backup_count, 'utf-8')
|
||||
h.setLevel(logging.INFO)
|
||||
h.setFormatter(cherrypy._cplogging.logfmt)
|
||||
cherrypy.log.access_log.addHandler(h)
|
||||
if access_file:
|
||||
h = logging.handlers.RotatingFileHandler(access_file, 'a', max_bytes, backup_count, 'utf-8')
|
||||
h.setLevel(logging.INFO)
|
||||
h.setFormatter(cherrypy._cplogging.logfmt)
|
||||
cherrypy.log.access_log.addHandler(h)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,9 +5,10 @@ After=network.target
|
|||
[Service]
|
||||
User=autocat
|
||||
Type=simple
|
||||
RuntimeDirectory=autocat
|
||||
WorkingDirectory=/var/lib/autocat/autocat3
|
||||
ExecStartPre=-/usr/bin/mkdir /var/run/autocat
|
||||
ExecStart=/usr/local/bin/pipenv run python CherryPyApp.py
|
||||
ExecStart=/var/lib/autocat/.local/bin/pipenv run python CherryPyApp.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue