iMac 5k powering off by itself
I got a iMac 5k (with 1 year warranty expiring soon) that work flawlessly until recently. It seems to power off by itself. The screen suddenly goes completely dark and keyboard led light would come on then off. It happened on three occasions and all three times I was looking thru a bunch of photographs. The first two times I was looking thru my photos stored in an external HDD. I was checking the Heart (Fav) on a bunch of photographs. At first maybe I thought my ext HDD was causing the problem but the third time this happened, I wasnt plug into any ext HDD but accessing a folder in my iMac.
Now once the screen goes black, I cant do anything. If I press the power button, it does nothing. I can only get it going by unplugging the power plug or turning off the switch on the mains. I would get no error codes or any message at all once it reboots after I press the power button.
This is my first time using an iMac. My warranty is expiring and I am wondering now if I should extend the warranty. I wasnt going to because of the cost. Is there any error log files I can look into to see whats going on?
Thanks in advance for all your help and answers
Mac (Retina 5K, 27-inch, Late 2014)
El Capitan 10.11.3
My original RAM is 8gb and I did not upgrade it.
iMac with Retina 5K display, OS X El Capitan (10.11.3), null