AppDaemon - log not found

Hi, I’m running AD in Docker on Synology DSM7.
AD is unable to find the log file for an automation I’ve written.

2022-01-05 14:45:22.106507 ERROR pump_overrun: User defined log /volume1/docker/appdaemon/a.log not found

apps.yaml

pump_overrun:
  module: pump_overrun
  class: Pump
  param1: 100
  log: /volume1/docker/appdaemon/a.log

appdaemon.yaml

logs:
    pump_overrun:
      filename: /volume1/docker/appdaemon/a.log

In File Manager on Synology

The file has full permissions for everyone.
Hopefully someone has come across this before. Cheers

Try changing to log: pump_overrun in apps.yaml

@proggie thanks for that. I changed apps.yaml to:

pump_overrun:
  module: pump_overrun
  class: Pump
  param1: 100
  log: pump_overrun

No luck unfortunately

After you make changes to appdaemon.yaml you have to restart AD for the app log to be available. Beyond that, you’ll need to provide additional information such as error logs.

@proggie yes definitely restarted the container. Thanks for your help. The issue is definitely in the Synology setup. Will try a few things today.

No the issue is that it’s Docker, and you are trying to write a file that the AppDaemon Docker container does not have access to. When you tell it to write to /volume1/docker/appdaemon/a.log you are telling the Docker container to write to that file INSIDE the container, a path that won’t exist unless it has been specifically mounted in the Docker run command or compose file. The whole point of Docker is that it DOES NOT have access to the entire file system of the HOST.

Additionally reading the documentation makes it quite clear - Writing AppDaemon Apps — AppDaemon 4.4.3 documentation that you only provide the user defined name of the log in the app section.

You then provide the actual filename of the log in the main AppDaemon configuration:
eg: Configuration — AppDaemon 4.4.3 documentation

logs:
  my_app:
    name: myapp
    filename: a.log
pump_overrun:
  module: pump_overrun
  class: Pump
  param1: 100
  log: myapp

@mobile.andrew.jones thank you for your time and comphrensive reply. I understand the concept a little better. I did the following, with no success:
appdaemon.yaml

logs:
    main_log:
    filename: appdaemon.log

    my_app:
      name: myapp
      filename: a.log

apps.yaml

pump_overrun:
  module: pump_overrun
  class: Pump
  param1: 100
  log: myapp

docker run command - initial setup

sudo docker run --name=appdaemon -itd --net=host --restart=always -e HA_URL="http://192.168.20.100:8123" -e TOKEN="my_token" -e DASH_URL="http://192.168.20.100:5050" -v /volume1/docker/appdaemon:/conf -v /etc/localtime:/etc/localtime:ro --name=appdaemon acockburn/appdaemon:latest

Synology

AD Error

2022-01-06 08:57:54.698610 ERROR pump_overrun: User defined log myapp not found

I note the main_log (appdaemon.log) wasn’t created either.

Try running AppDaemon in interactive mode (ie don’t use -d) and see what errors show up, we are looking to see if there is a Error 13 file permission error creating the log file in the first place.

OK. How do I run Docker manually on the Synology? via the terminal on UI or ssh to docker?

Ok I ran:

sudo docker run --name=appdaemon -it --net=host --restart=always -e HA_URL="http://192.168.20.100:8123" -e TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIzYjQzM2RhNDM0OWI0M2RlODU5MjlkODhiOTdiYTgyNiIsImlhdCI6MTYzNjc1NDE4OCwiZXhwIjoxOTUyMTE0MTg4fQ.ORGDHbojLNxE9MbXt0RHtS-LTGTWr22TMmgYzMc_2-8" -e DASH_URL="http://192.168.20.100:5050" -v /volume1/docker/appdaemon:/conf -v /etc/localtime:/etc/localtime:ro --name=appdaemon acockburn/appdaemon:latest

This is the log output

2022-01-06 10:21:25.275519 INFO AppDaemon: Initializing app pump_overrun using class Pump from module pump_overrun                                                                                          
2022-01-06 10:21:25.277578 ERROR pump_overrun: User defined log myapp not found                                                                                                                             
2022-01-06 10:21:25.282420 INFO pump_overrun: <class 'method'>                                                                                                                                              
2022-01-06 10:21:25.286367 INFO MQTT: Topic pump_run_time_last_5m already subscribed to                                                                                                                     
2022-01-06 10:21:25.295044 INFO pump_overrun: Pump Overrun automation started                                                                                                                               
2022-01-06 10:21:26.316814 INFO AppDaemon: Terminating pump_overrun                                                                                                                                         
2022-01-06 10:21:26.320484 INFO AppDaemon: Reloading Module: /conf/apps/pump_overrun.py                                                                                                                     
2022-01-06 10:21:26.326217 INFO AppDaemon: Initializing app pump_overrun using class Pump from module pump_overrun                                                                                          
2022-01-06 10:21:26.329201 ERROR pump_overrun: User defined log myapp not found                                                                                                                             
2022-01-06 10:21:26.334321 INFO pump_overrun: <class 'method'>                                                                                                                                              
2022-01-06 10:21:26.338227 INFO MQTT: Topic pump_run_time_last_5m already subscribed to                                                                                                                     
2022-01-06 10:21:26.347053 INFO pump_overrun: Pump Overrun automation started     

No Error 13 unfortunately