It's your web-server's error_log is set to debug. While the code shown is PHP.
So, you have to make your PHP to log errors. Check values from phpinfo().
log_errors have to be set to
null. This way PHP will report all the errors in the error_log
Also, get rid of try/catch echo stuff. NEVER output an error message on a live server.
And set PDO in exception mode.
$con->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );