Logging to OneDrive

I struggle with writing a log file to my OneDrive.

I have set up a Backup procedure using the integration as described in https://www.home-assistant.io/integrations/onedrive and that works fine.

Next to this I use the File integration and Automation to log a Notification message.
Example YAML:

alias: Regen log
description: ""
triggers:

  • trigger: time_pattern
    hours: "*"
    minutes: /5
    conditions:
    actions:
  • action: notify.send_message
    metadata: {}
    data:
    message: "{{ states("sensor.neerslagintensiteit") }}"
    target:
    entity_id: notify.file_4
    mode: single

That works fine too, but only to a local file (e.g. config/www/message.log)

I would like to be able to write the Notification to my OneDrive directory. Can somebody help?

Resolved by adding an automation that copies the file form the local drive to OneDrive with automation:

alias: Verzend regenlog naar OneDrive
description: ""
triggers:
  - trigger: time_pattern
    hours: "*"
    minutes: /3
conditions: []
actions:
  - action: onedrive.upload
    metadata: {}
    data:
      filename:
        - /config/www/regen_log.csv
      config_entry_id: 01JYXERP9RWH20WEHHXFZ69DH7
      destination_folder: /regenlog
mode: single