send log to middleware