Skip to content

Commit 1cbdd4e

Browse files
committed
move cherrypy logs to the default logs directory as well
1 parent d8cbc09 commit 1cbdd4e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

source/zimonGrafanaIntf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,15 +616,21 @@ def validateCollectorConf(args, logger):
616616

617617
def updateCherrypyConf(args):
618618

619+
path, folder = os.path.split(args.logFile)
620+
if not os.path.exists(path):
621+
os.makedirs(path)
622+
accesslog = os.path.join(path, 'cherrypy_access.log')
623+
errorlog = os.path.join(path, 'cherrypy_error.log')
624+
619625
globalConfig = {
620626
'global' : {
621627
'server.socket_host': '0.0.0.0',
622628
'server.socket_port' : args.port,
623629
'server.socket_timeout' : 60, # increase timeout to 60s
624630
'request.show_tracebacks' : False,
625631
'log.screen' : False, # turn off logging to console
626-
'log.access_file': "cherrypy_access.log",
627-
'log.error_file': "cherrypy_error.log",
632+
'log.access_file': accesslog,
633+
'log.error_file': errorlog,
628634
'tools.encode.on' : True,
629635
'tools.encode.encoding' : 'utf-8'}}
630636
cherrypy.config.update(globalConfig)

0 commit comments

Comments
 (0)