Please use code tags in your posts.
I log my Home Assistant starts with an automation. Maybe this might help you:
- id: '1729005744617'
alias: Log Home Assistant Start
description: Logs every HA start to www/home_assistant_log.txt
triggers:
- trigger: homeassistant
event: start
conditions: []
actions:
- action: shell_command.log_home_assistant_start
metadata: {}
data: {}
mode: single