custom logrotation

my staff and i are trying to figure out how to write some custom logrotation scripts, so after webalizer and the others parse the logs of a domain, it logrotates it. this will keep loads down from excessively large logs being parsed

question is this, where does cpanel/whm get the active list of domains and associate them w/ users etc when it parses them w/ webalizer and analog etc

anyone know? this would make this scripting process a HELLUVA lot easier