When using the Mendix cloud, you can access/download the logs via Sprintr if you have enough access rights. Open your project and go to ‘Logs’ underneath ‘Deploy’ in the left section of your page.
If you want to display the logs in-app, you could consider using a version of the Logging Module in the marketplace. Please keep in mind that the log messages will be written to your app database in this case, which could cause a performance or security issue.
Last but not least, you can use external tools to get the most out of your logs. You can read more about this below.
Hopefully, this helps.