Logging In Loop (ARCH8164)
Key kotlin.logging.logging-in-loop · Severity info · Category logging
Flags info / warn / error log calls inside loop bodies - one line per iteration floods the sink. A rescue handler inside the loop reports one failed item and is excepted.
Incorrect
Section titled “Incorrect”for (r in rows) log.info("row {}", r.id)Correct
Section titled “Correct”log.info("processed {} rows", rows.size)Aggregate after the loop, or log at debug.