Fail2ban dumping spurious UTF characters and output to console

Many have now run into this problem:

After installing fail2ban (using the EPEL repo) on a CentOS 6.3 of 6.4 machine (x86_64), the startup logs are being sent to the console. This can be very annoying:

Message from syslogd@vps36769 at Aug  6 16:41:07 …
 �<30>fail2ban.filter : INFO   Added logfile = /var/www/sites/default/logs/access_log

It is a known bug, see: https://github.com/fail2ban/fail2ban/issues/32

You can suppress this dumping to console by changing the logtarget in fail2ban.conf. According to fail2ban.conf the default allready is “/var/log/fail2ban.log”.
However, I see:

# Values:  STDOUT STDERR SYSLOG file  Default:  /var/log/fail2ban.log
#
logtarget = SYSLOG

So I changed SYSLOG to: /var/log/fail2ban.log

# Values:  STDOUT STDERR SYSLOG file  Default:  /var/log/fail2ban.log
#
logtarget = /var/log/fail2ban.log

Then restart fail2ban and the messages won’t bother you any longer.

Finally, you should also do the same to the logrotate config: /etc/logrotate/fail2ban

Otherwise it will all be back after 1 logrotate.