stateLog Middleware