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 ...
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
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-act...
Views
Replies
Total Likes
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-act...
Views
Replies
Total Likes
Views
Replies
Total Likes
yes this is an example:
curl --location --request GET 'https://my-namespace-stage.adobeioruntime.net/api/v1/web/my-app-0.0.1/read-state?key=name' \
--header 'X-OW-EXTRA-LOGGING: on'
Views
Replies
Total Likes
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
Hi @duypnguyen
We can see the error logs once in a while,
2020-09-29T11:33:21.427Z stdout: ERRROR-------------> FetchError: 401 Unauthorized ('No session is available for user xxxx@AdobeID') on GET https://reactor.adobe.io/companies
at Reactor.requestAndLog (/nodejsAction/hc9jf2d3/index.js:41608:13)
But most of the time there is nothing returned if use 'aio app logs'.
We already added the following header for the action invocation ( headers['X-OW-EXTRA-LOGGING'] = 'on').
Still no error logs, is anything missed from our end?
Views
Replies
Total Likes
Hi @eldhov19157560 - do you have the activation ID of the invocation which you think there should be logs but not seeing them with `aio rt activation logs ID`?
In an SPA created by the Firefly generator with react spectrum, you can add the logging header to App.js so that it is enforced during your development:
async function actionWebInvoke (actionName, headers = {}, params = {}) {
console.log('params.url = ', params)
if (!actionName || !actions[actionName]) {
throw new Error(`Cannot fetch action '${actionName}' as it doesn't exist.`)
}
const response = await fetch(actions[actionName], {
method: 'post',
headers: {
'Content-Type': 'application/json',
'x-ow-extra-logging': 'on',
...headers
}
}
}
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi @Urs_Boller/ @duypnguyen,
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.
Views
Replies
Total Likes
Views
Like
Replies