You can use the Deploy API: https://docs.mendix.com/apidocs-mxsdk/apidocs/deploy-api/#319-download-archived-logs-for-a-specific-date-mendix-cloud-v4-only
Alternatively, you can use Datadog for log management. Mendix has built-in support for Datadog so it is very easy to set up.