WooCommerce by default deletes the logs within 30 days. However, it lets you control this feature via woocommerce_logger_days_to_retain_logs
filter.
This is a small plugin built on top of that filter that will let you define the number of days you’d like to keep the logs for.

Usage:
- Install and Activate this plugin
- Configure the number of days log should be kept under WooCommerce > Settings > General > WooCommerce Logs > Days to keep logs – Define the number of days here
- Plugin will ensure that logs are removed after days you’ve defined.
This setting works with woocommerce_cleanup_logs
cron job that runs daily. You’ll want to either wait until the cron job runs, or manually run it if you want to see it in action before that.