[ https://issues.apache.org/jira/browse/SLING-11793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17695683#comment-17695683 ]
Joerg Hoh commented on SLING-11793: ----------------------------------- This approach limits the number of messages (each of unlimited length); wouldn't it make more sense to limit the total size of the message (e.g. by number of characters or number of bytes)? > Limit log messages via JobExecutionContext.log() > ------------------------------------------------ > > Key: SLING-11793 > URL: https://issues.apache.org/jira/browse/SLING-11793 > Project: Sling > Issue Type: Improvement > Components: Event > Reporter: Rishabh Kumar > Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Currently, every log message passed via JobExecutionContext.log() is appended > to previous messages and then stored in the repository. This can bloat the > repository and is discouraged as described in JavaDoc: > {quote}A job consumer can use this method during job processing to add > additional information about the current state of job processing. As calling > this method adds a significant overhead it should only be used to log a few > statements per job processing. If a consumer wants to output detailed > information about the processing it should persists it by itself and not use > this method for it. The message and the arguments are passed to the > MessageFormat class.{quote} > Some job implementations ignore this advice and still log potentially many > messages during execution. > {color:#172b4d}The Sling Job implementation should ignore further log > messages when a threshold is reached. This may be configurable to make it > backward compatible{color}. -- This message was sent by Atlassian Jira (v8.20.10#820010)