Custom Rule ST-USG-020 - Minimum Log Messages - source code?

Check this documentation for guidance Building Custom Rules