write log to sdcard