Firefly Action logging | Community
Skip to main content
Level 4
June 18, 2021
Solved

Firefly Action logging

  • June 18, 2021
  • 1 reply
  • 1473 views

hi,

 

we created simple headless action and asset compute worker in the same project, logs are written using  (for example)

    logger.info('Calling the main action');
    console.log('Calling the main action');
 
When application is run using : aio app run, and action is triggered in the browser (https://80xx-xxheadlessapp-xxdemows.adobeioruntime.net/api/v1/web/xxHeadlessApp-0.0.1/myaction/)
in the cmd line we can only see logs coming from asset compute worker and there are no logs from action.
Executing: aio rt activation list
returns only activation list from worker
Executing: aio app logs, it returns empty
 
When application is run using : aio app run -- local (we set two docker images as per instructions, nodejs and openwhisk)
and action is executed (by running the same url  as above, https://80xx-xxheadlessapp-xxdemows.adobeioruntime.net/api/v1/web/xxHeadlessApp-0.0.1/myaction/) there's no debug lines of any kind (action or asset compute worker) in the cmd line.
 
Any advice how to make logs working ?
 
 
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by duynguyen_adobe

Hi @nbg62 - so you got 2 separate questions:

1. `aio app run`, logs available from the asset compute worker, not available from the simple headless action. This is expected; because the asset compute worker (action) is invoked in a "non-blocking" mode, its activation record and logs are always saved (for 7 days); on the other hand, the headless action is invoked in a "blocking" mode (web request), so its activation record is not saved (when the action runs successfully). For debugging purpose, you can enable the activation record to be saved by adding this header to the web request "x-ow-extra-logging: on". Please remember to remove this header in production, as it may impact your action performance. More details at: https://www.adobe.io/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/logging_monitoring.md.

2. The problem you are seeing is because you are calling your action on I/O Runtime (at https://80xx-xxheadlessapp-xxdemows.adobeioruntime.net/api/v1/web/xxHeadlessApp-0.0.1/myaction/), while in the command line you are getting activation records from localhost (by running `aio app run --local`). Please note when you run your app in localhost, the action URL should be like https://localhost:3233/api/v1/web/guest/xxHeadlessApp-0.0.1/myaction.

1 reply

duynguyen_adobeAdobe EmployeeAccepted solution
Adobe Employee
June 21, 2021

Hi @nbg62 - so you got 2 separate questions:

1. `aio app run`, logs available from the asset compute worker, not available from the simple headless action. This is expected; because the asset compute worker (action) is invoked in a "non-blocking" mode, its activation record and logs are always saved (for 7 days); on the other hand, the headless action is invoked in a "blocking" mode (web request), so its activation record is not saved (when the action runs successfully). For debugging purpose, you can enable the activation record to be saved by adding this header to the web request "x-ow-extra-logging: on". Please remember to remove this header in production, as it may impact your action performance. More details at: https://www.adobe.io/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/logging_monitoring.md.

2. The problem you are seeing is because you are calling your action on I/O Runtime (at https://80xx-xxheadlessapp-xxdemows.adobeioruntime.net/api/v1/web/xxHeadlessApp-0.0.1/myaction/), while in the command line you are getting activation records from localhost (by running `aio app run --local`). Please note when you run your app in localhost, the action URL should be like https://localhost:3233/api/v1/web/guest/xxHeadlessApp-0.0.1/myaction.

nbg62Author
Level 4
June 21, 2021
Thank you, this helps, very useful info.