Log::Log4perl is an excellent choice, but adds a dependency. I'd suggest to have a fallback mechanism so that you can utilize the module but don't depend on it; it then comes nearly for free to give the user the opportunity to provide his own callback instead. When dealing with CGI scripts, I often wish I had an easy way to capture error and debug messages to display them in some way other than what's common.
Makeshifts last the longest.