I’d like to stop log statements triggering Checkstyle’s “Multiple String Literals” rule. That is, if a string is repeated in multiple log statements in a class, then Checkstyle should ignore it.
I don’t want to litter my code with dozens of //CHECKSTYLE:OFF/ON commands around log statements and, as far as I can tell, neither of the appropriate config options (ignoreStringsRegexp and ignoreContextOccurence) can be used for this purpose.
Unfortunately, that is impossible out of the box. What you are really asking for is a modification of behavior for one check. The standard way of implementing such a thing is by implementing your own custom check. (Another way would be by implementing a filter, but I think in your case you need a check, not a filter.)