SSL debugging is a pain. IO::Socket::SSL debug output does not make it better, i.e. you get only meaningful information out of it if you already understand SSL and openssl.
To get better help please with your problem please
provide the version number of IO::Socket::SSL you are using.
give example code which triggers your problem.
provide information about the certificate of the server, e.g. issuer, common name, subject alternative names and chain certificates. These information are needed to check why the verification could fail.
As for integrating the debug output with Log4Perl: $IO::Socket::SSL::DEBUG controls both debugging from IO::Socket::SSL and Net::SSLeay (it is an alias to $Net::SSLeay::trace) and both modules simply write to STDERR. So you need to capture this.