2017 iMac shuts down every few days
iMac running MacOS 10.14.2 has been shutting down every few days. Here is the beginning of the system log for the relevant period of one such shutdown. (I tried to post more of the log, but ran into the 5000 character limit, even though my post was just under 5000 characters.)
Dec 31 14:30:46 Connies-2017-iMac syslogd[54]: ASL Sender Statistics
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.xpc.launchd.user.domain.501.100006.Aqua): Caller not allowed to perform action: loginwindow.106, action = service removal, code = 150: Operation not permitted while System Integrity Protection is engaged, uid = 0, euid = 501, gid = 20, egid = 20, asid = 100006
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.AirPlayUIAgent[379]): Service exited due to SIGKILL | sent by loginwindow[106]
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.CoreLocationAgent[317]): Service exited due to SIGKILL | sent by loginwindow[106]
.
.
.
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.storeassetd[431]): Service exited due to SIGKILL | sent by loginwindow[106]
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.imklaunchagent[332]): Service exited due to SIGTERM | sent by loginwindow[106]
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.coreservices.uiagent[13153]): Service exited due to SIGKILL | sent by loginwindow[106]
.
.
.
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.imfoundation.IMRemoteURLConnectionAgent): Unknown key for integer: _DirtyJetsamMemoryLimit
Dec 31 14:30:58 Connies-2017-iMac SystemUIServer[13191]: DEPRECATED USE in libdispatch client: dispatch source activated with no event handler set; set a breakpoint on _dispatch_bug_deprecated to debug
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.imfoundation.IMRemoteURLConnectionAgent): Unknown key for integer: _DirtyJetsamMemoryLimit
Dec 31 14:30:58 Connies-2017-iMac Spotlight[13194]: DEPRECATED USE in libdispatch client: dispatch source activated with no event handler set; set a breakpoint on _dispatch_bug_deprecated to debug
Dec 31 14:30:58 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.imfoundation.IMRemoteURLConnectionAgent): Unknown key for integer: _DirtyJetsamMemoryLimit
Dec 31 14:30:59 Connies-2017-iMac SystemUIServer[13191]: DEPRECATED USE in libdispatch client: Setting timer interval to 0 requests a 1ns timer, did you mean FOREVER (a one-shot timer)?; set a breakpoint on _dispatch_bug_deprecated to debug
Dec 31 14:31:03 Connies-2017-iMac sessionlogoutd[13198]: DEAD_PROCESS: 106 console
Dec 31 14:31:03 Connies-2017-iMac shutdown[13199]: SHUTDOWN_TIME: 1546284663 735439
Dec 31 14:31:03 Connies-2017-iMac com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.system): System shutdown initiated by: shutdown.13199<-sessionlogoutd.13198<-launchd.1
Dec 31 16:20:13 localhost bootlog[0]: BOOT_TIME 1546291213 0
What is causing this?