Can i limit the file size of a log file?

OS Name/Version:
Ubuntu Linux 24.04.2 (server version, no gui)
AMP Release “Phobos” v2.6.2, built 17/06/2025 09:10

Instance: Minecraft Paper server version 1.8.8

Problem Description:

The system totally ran out of diskspace because the logfile (single file) in this server reached 50GB within days. Webmin was working but AMP did not start anymore.
I managed to locate and delete said logfile after which AMP was able to run again.

I want to limit the size of the logfile, ideally by removing old log entries.
Is this possible?