Prevent editor-prev.log file from getting too big

So there are lots of people who’ve noted that the editor-prev.log filesize can get huge.

Obviously there’s lots of value to looking at it to find out why it’s so big, but folks are regularly complaining that it gets so big that they can’t even open it without splitting the file up somehow. My computer recently crashed after the file suddenly ballooned to almost 300gb.

Is there any way to prevent the file from getting so big in the first place? Maybe capping it at 10gb or whatever?

Sorry but 300 gb log file means you do something wrong ^^. It’s not the “editor-prev.log” that gets that big, it’s your actual editor log file. Unity will rename the old editor log to editor-pref.log at start. Have you ever bothered to look into that log to see what’s taking up that much space? That sounds like you have a bazillion Debug.Log / print calls per frame or that you somehow generate countless of warnings or errors. You should find the root of your problem instead of trying to fix the symptoms.

Each time you restart the Unity editor you start with a new empty editor log. So if your log grows to 300+GB that has to happen within the same session. About opening / handling of large log files, there are plenty of solutions out there like this one (first result after a 2 second google search). Anyways as I said you should find and fix the cause of your exploding log file rather than patching around that symptom.