Title: Not logging pingbacks
Last modified: August 31, 2016

---

# Not logging pingbacks

 *  [simonmwilson](https://wordpress.org/support/users/simonmwilson/)
 * (@simonmwilson)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/not-logging-pingbacks/)
 * I’m trying to log pingbacks so I can fail2ban the IPs. The pingbacks are not 
   getting logged.
 * With “define(‘WP_FAIL2BAN_LOG_PINGBACKS’,true);” and “define(‘WP_FAIL2BAN_PINGBACK_LOG’,
   LOG_LOCAL3);” nothing gets written to Local3 (which is active, I have tested 
   the facility with a simple dummy test:
    <?php openlog(“test”,LOG_NDELAY,LOG_LOCAL3);
   syslog(LOG_NOTICE,”Hey”); closelog(); ).
 * I am getting about 10,000 pingbacks per day, but NONE of them trigger this plugin’s
   logging.
 * Catching the POST xml data shows me the following:
 * 93.174.93.234<?xmlversion=”1.0″?>
    <methodCall> <methodName>pingback.ping</methodName
   > <params> <param> <value> <string>[http://www.reportyor.com/?cat=hadise&id=11208</string&gt](http://www.reportyor.com/?cat=hadise&id=11208</string&gt);
   </value> </param> <param> <value> <string>[http://blog.simonandkate.net/20140415/beautiful-new-zealand</string&gt](http://blog.simonandkate.net/20140415/beautiful-new-zealand</string&gt);
   </value> </param> </params> </methodCall>
 * It appears to be a valid pingback. Yes I can disable pingback, but I’d rather
   log them and fail2ban them. I could also just catch xmlrpc.php calls and ban 
   them, but I use xmlrpc…
 * Can this plugin log the pingbacks?
 * [https://wordpress.org/plugins/wp-fail2ban/](https://wordpress.org/plugins/wp-fail2ban/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [invisnet](https://wordpress.org/support/users/invisnet/)
 * (@invisnet)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/not-logging-pingbacks/#post-7172677)
 * It’s always worked for me, so I’m wondering if you’ve got another plugin installed
   that’s not playing nicely with others.
 * Version 3.0 now logs failed pingbacks which are the ones you really want to block.
 *  Thread Starter [simonmwilson](https://wordpress.org/support/users/simonmwilson/)
 * (@simonmwilson)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/not-logging-pingbacks/#post-7172678)
 * I’ve installed v3, will see how it goes. I’ve added the following to wp-config.
   php to start with just to see if it logs, if it works I will jump into fail2ban
   config.
 * It’s a CentOS system and uses AUTHPRIV…
 * define(‘WP_FAIL2BAN_AUTH_LOG’,LOG_AUTHPRIV);
    define(‘WP_FAIL2BAN_LOG_PINGBACKS’,
   true); define(‘WP_FAIL2BAN_PINGBACK_LOG’,LOG_LOCAL3);
 * The requests are hitting apache as I see all of the httpd processes…
 *  [trogau](https://wordpress.org/support/users/trogau/)
 * (@trogau)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/not-logging-pingbacks/#post-7172686)
 * I just noticed I was getting a lot of pingback errors in my auth.log, but they
   weren’t getting blocked properly.
 * Upon inspection, I noticed that the format of the line in auth.log looked a little
   weird:
 * `Apr 7 03:13:13 trog 33 generated from 185.130.5.165[3913]: Pingback error 33
   generated from x.x.x.x`
 * The line in wp-fail2ban.php responsible for this is:
 * `\syslog(LOG_NOTICE,'Pingback error '.$ixr_error->code.' generated from '.remote_addr());`
 * Nothing obviously wrong with it. I changed the quotes from single quotes to double
   quotes, a la:
 * `\syslog(LOG_NOTICE,"Pingback error $errcode generated from ".remote_addr());`
 * … (with $errcode populated in another line) and now it logs correctly, a la:
 * `Apr 7 03:13:18 trog wordpress(103.16.128.201)[3913]: Pingback error 33 generated
   from x.x.x.x`
 * Weird. But it works fine like this.
 *  Thread Starter [simonmwilson](https://wordpress.org/support/users/simonmwilson/)
 * (@simonmwilson)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/not-logging-pingbacks/#post-7172687)
 * At least you are getting the log entries. It’s not logging at all for me, so 
   your issue is not connected with this thread.
 * WP fail2ban is still not logging at all for me.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Not logging pingbacks’ is closed to new replies.

 * ![](https://ps.w.org/wp-fail2ban/assets/icon-256x256.png?rev=2814701)
 * [WP fail2ban - Advanced Security](https://wordpress.org/plugins/wp-fail2ban/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-fail2ban/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-fail2ban/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-fail2ban/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-fail2ban/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-fail2ban/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [simonmwilson](https://wordpress.org/support/users/simonmwilson/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/not-logging-pingbacks/#post-7172687)
 * Status: not resolved