Elastic Beanstalk: log task customization on Amazon Linux 2 platforms

On Amazon Linux 2 the folder is:

/opt/elasticbeanstalk/config/private/logtasks/bundle

The .ebextensions/mydaemon-logfiles.config should be:

files: 
  "/opt/elasticbeanstalk/config/private/logtasks/bundle/mydaemon-logs.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
       /var/mydaemon/deeperlogs/*.log

container_commands:
  append_deeperlogs_to_applogs:
    command: echo -e "\n/var/log/eb-docker/containers/eb-current-app/deeperlogs/*" >> /opt/elasticbeanstalk/config/private/logtasks/bundle/applogs

The mydaemon-logfiles.config also adds deeperlogs into applogs file. Without it deeperlogs will not be included in the download log zip bundle. Which is intresting, because the folder will be in the correct location, i.e., /var/log/eb-docker/containers/eb-current-app/deeperlogs/. But without being explicitly listed in applogs, it will be skipped when zip bundle is being generated.

I tested it with single docker environment (3.0.1).

The full log bundle successful contained deeperlogs with correct log data:

enter image description here

enter image description here

Hope that this will help. I haven't found any references for that. AWS documentaiton does not document this, as it is mostly based on Amazon Linux 1, not Amazon Linux 2.