I have a master mysql server with only one attached slave.
I have configured my master server to keep logs for 2 day, but in a simple configuration like mine is possible to configure an environment where master logs are deleted as soon as be consumed by the ONLY ONE slave?
No, there is no option for what you're describing.
The reason is that replication is asynchronous. The source has no idea how many replicas are subscribed, it only knows which replicas are connected at any given time. That is, a replica could be offline and expect to reconnect and resume reading binlogs where it left off.
The only option in stock MySQL for binary log expiration is the config variable config_logs_days
.
Percona Server adds another option, to expire binlogs if the number of files is more than max_binlog_files
. This helps to avoid running out of disk space if you have a short burst of heavy traffic before expire_logs_days
causes old logs to be expired.