create log functionality