write log to script directory