clear log file space linux

C++
find /var/log -type f -delete
find /var/log -type f -regex ".*\.gz$"
find /var/log -type f -regex ".*\.[0-9]$"

Source

Also in C++: