Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Firefly Action logging

urosk
Level 1
Level 1

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 ?
 
 
 
1 Accepted Solution
duypnguyen
Correct answer by
Employee
Employee

Hi @urosk - 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/gui....

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.

View solution in original post

2 Replies
duypnguyen
Correct answer by
Employee
Employee

Hi @urosk - 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/gui....

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.

View solution in original post