writelog hook