Hi Robin,
I don’t believe there is an API to download log files – perhaps its on the roadmap.
As an alternative, you could install the Logging Module from the Marketplace https://marketplace.mendix.com/link/component/159 . This module persists log entries into a database entity. Once that’s installed, you could save or backup those log entries externally via an api or generate a daily log file and save it to a location of your choice.
Hope that helps,
Mike