Best-practice logging
AWS Glue is designed to best log via CloudWatch (see this documentation for details). Since your logs are getting too big to identify the root cause, and there's no event to hook in CloudWatch that'd line up with @varnit's suggestion, we can do the next-best thing: create a CloudWatch dashboard with a query pulling a filtered version of your logs.
Create a custom dashboard
On the CloudWatch console, navigate to "Dashboards" and select "Create dashboard". Name it something meaningful (e.g., "glue-custom-logs"). Continuing, we'll add and configure a "Query results" widget. Choose your log stream, likely "/aws-glue/jobs/error" if you went with the defaults, and note that Glue defaults to the error stream if you're using normal python prints. Choose a sane window of time for your lookback so your results are somewhat pre-filtered.
If you have a unique identifier in your custom log messages, such as "glue-custom-log", we can now easily write a query filtering the results:
fields @timestamp, @message
| filter @message like 'glue-custom-log'
| sort @timestamp desc
Save the widget, save the dashboard, and you now have an easy-access pre-filtered log in CloudWatch for your custom logging needs.