Network client is released unexpectedly and mac goes to sleep My jenkins builds crash because of broken ssh pipes into my iMac.
The ssh connection is dropped unexpectedly and the iMac instantly enters sleep state. I cant figure out why. Here's the pmset -g logoutput:

2018-06-22 14:49:16 +0200 Assertions  PID 48(powerd) Released NetworkClientActive "com.apple.powermanagement.ttyassertion" 00:09:19  id:0x11000013f7 [System: PrevIdle]
2018-06-22 14:49:16 +0200 Sleep       Entering Sleep state due to 'Maintenance Sleep': Using AC                     77 secs


I cant figure out why NetworkClientActive gets released nor do I find any information about this. Where do I find logs why the sleep happens?
Where do I find logs why the sleep happens?


how to find out the start time of last sleep


  You can use the pmset command to obtain this information. The
  following command obtains a log of the sleep/wake entries then
  restricts this to the last entry in the list which should be the most
  recent sleep:
  
  pmset -g log | grep sleep | tail -n 1
  
  You can obviously play around with anything after pmset -g log to give
  you what you need.