How can I determine what is causing my Nexus 4 to freeze? I have a new-ish Nexus 4 with Cataclysm ROM installed (rooted, 4.3).

The device has recently started freezing - being unresponsive to button presses, but with the white LED pulsing. I have to long-press the power button and then press it again to restart.

It used to freeze occasionally - say, once a week - but over the past week or two it has started to freeze every day or at least every other day.

I cannot think of a recently-installed application or setting change that might have triggered this.

I'm wondering if there's a way for me to determine 'when' the device freezes and 'what' it is that's causing it to freeze, ideally so I can determine whether or not it is the ROM or the device at fault. Is there an application that can log device behaviour and be read by a semi-technical user like me?
There are some ways to pin down your problem. The easiest way should be reading out the last_kmsg which is normally stored under /proc/last_kmsg. The kernel logs everything in there and it can be read until the next reboot.

So reading last_kmsg always shows things that happened before the device rebooted the last time.

Another way would be using "adb logcat" or - more comfortable - the app Catlog which can record your logcat into a .txt file on the SD-Card. Be advised that logcat is not the same as a kernel message but it also includes messages from user space apps and UI stuff.

If I'm allowed to make a wild guess, I'd say that it's the ROM's fault (e.g. undervolting or something else going wrong).

Best regards!