iMac display goes to sleep randomly during use -- how and why? Are there event logs?
You may have a Hot Corner checked. if your mouse touched a hot corner it will respond in a chosen way. One Hot Corner action is to put display to sleep. To check this go to System Preferences, Desktop &amp; Screen Saver. Click on the Screen Saver tab and at the bottom of that pane is a button for Hot Corners. Click this and see if you hve a hot corner set up.