add log and pattern