Permission denied error occurs on shell script after macos update to sonoma from ventura

I have developed a macos app. in the app, launchd .plist file to run a shell script. (.plist file's location is /Library/LaunchAgents/) In the script, I use below code to output log info. Before update to sonoma , it worked well.

    local FileLogsTask="/var/log/my_task.log"
    echo ${Timestamp}:${Msg} >> "${FileLogsTask}"

After updated to sonoma.

  1. I found old my_task.log was lost
  2. After script is executed, my_task.log was not created
  3. 「/var/log/my_task.log: Permission denied」error is outputted

Has anyone encountered similar problems, know how to solve this problem?

Permission denied error occurs on shell script after macos update to sonoma from ventura
 
 
Q