aio logs not working | Community
Skip to main content
Urs_Boller
Community Advisor
Community Advisor
September 28, 2020
Solved

aio logs not working

  • September 28, 2020
  • 2 replies
  • 5690 views

since my latest update I can't see any logs of my actions - but they are working as expected in local environment. I hope I can provide enough information so somebody might see what I'm doing wrong ...

1) local environment, running "aio app run --local" and invoking an action shows me some log entries as expected:

2) with no changes at all I then executed "aio app run" (no errors) and invoking the exact same action (with success in the UI), nothing happens in the logs. I checked the list with "aio runtime activation list" and could not find any new entries at all ... (which looks strange, what might be the issue?)

3) with no changes at all I then executed "aio app deploy" (no errors) and tried again the exact same action (again with success in the UI).

 

what is strange: at the same time I have an action triggered by whisk/alarms/interval which immediately starts after the app deploy. and this action executes as expected and I can see the entry in the "aio rt activation list" and fetch the logs with "aio rt activation logs ID". so the logs are not completely failing, just for my actions invoked by the web UI.

 

somehow, I managed to get the following error code, but can't tell what exactly I've done to get an activation entry ... maybe this helps: 

and here are my settings from the package.json (only those I think must be mentioned)

 

"@adobe/aio-lib-ims": "^4.1.1", "@adobe/aio-sdk": "^2.3.0", "@adobe/exc-app": "^0.2.21", "core-js": "^3.6.4", "ngrok": "^3.3.0", "react": "^16.13.1", "react-dom": "^16.13.1" "regenerator-runtime": "^0.13.5"

 

hopefully somebody can help me fix the issue ...

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 @urs_boller - what you observed with no logs for web invocation is expected, because the logs are not automatically persisted. For debugging you could use a flag to force it. More background here: https://github.com/AdobeDocs/adobeio-runtime/blob/master/guides/logging_monitoring.md#retrieving-activations-for-blocking-successful-calls

2 replies

duynguyen_adobeAdobe EmployeeAccepted solution
Adobe Employee
September 29, 2020

Hi @urs_boller - what you observed with no logs for web invocation is expected, because the logs are not automatically persisted. For debugging you could use a flag to force it. More background here: https://github.com/AdobeDocs/adobeio-runtime/blob/master/guides/logging_monitoring.md#retrieving-activations-for-blocking-successful-calls

Adobe Employee
September 29, 2020

Hi @urs_boller, ok now I got your question. Indeed there are 2 points in it.

1. Log messages as direct output of the `aio app run (--local)` command. This is only possible in local mode as you pointed out. It is not possible in non-local mode because of the limitation in the second point below. In that case, you could do `aio app logs` to see logs.

2. Activation records and logs only persisted for async invocations (by default): this is the point I referred to in the earlier comment. Blocking invocations (e.g. web requests) are not recorded if they are successful. If you want to see logs, the web request must include the required header. The curl command just illustrates how you pass this header.

 

For SPA local development, I believe that there was an idea to automatically attach the logging header when you do `aio app run`. Let me follow up if there's something tangible for it.

banerjee-ronitb
June 24, 2021

Hi @urs_boller@duynguyen_adobe,

I was recently trying this out and I was able to tail the logs by using the below aio cli:

aio app:logs --action=generic --tail

and this keeps on tailing the logs as and when I hit my function via the Http.