Job's log exceeded limit of 4194304 bytes.

I am running a project on gitlab.com shared runner in gitlab-ci. The project is a gradle project. The build is failing with below message

Job's log exceeded limit of 4194304 bytes.

How do I increase the log size limit so that build does not fail? Very recently this issue popped up, earlier I did not face such issue with the same project.