Jump to content

Application log: rotate on restart


photo

Recommended Posts

I'd like it if we kept the last application log when the system was restarted. The scenario is that, should there be a problem with our Unignine-based product the customer will re-start the application and then call us to tell us about the issue. At the moment the old log is truncated on re-start so any chance of debugging is lost. 

 

My suggestion is that the old log is renamed to ".last" each time the application is run so we always have the application's log history. I think this would be pretty simple to implement.

Link to comment
  • 4 weeks later...

Hi. You can manually copy a engine log file before start engine. It can be done using shell command or in your launcher application or somewhere else.
 
For example you can use simple Python engine launcher:

#this is a python launcher code

import os
import shutil

log_file = os.path.curdir + os.path.sep + 'log.html'
last_log = os.path.curdir + os.path.sep + 'log_last.html'

shutil.copy(log_file,last_log)

os.system(os.path.curdir + os.path.sep + 'main ' + '-engine_log ' + log_file + ' -sound_app openal \
	-data_path ../../../ -system_script core/unigine.cpp extern_plugin -Interface')
Link to comment
×
×
  • Create New...