In this video, we are going to see a lot of the invocation logs from the Amazon cloud logs using to
select commands.
So far we have checked the looks from the main console, but we can also check from the command line
with using the same commands.
Let's get started.
Before we start, we can check the reference documentation about the logs on the fly.
You can use these links on the lecture 51 commands x file here.
You can find the logs description, documentation from the command line reference.
If you scroll down under the logs, we have some available commands that we can use.
During this video, I will use the describe log groups we can see in here, describe log groups and
also we will use get log events.
You can either see the get log events if you open these describe log groups, you can see the options
and configurations, an example usage in here.
And also if you see the get log events, you can see the options and configurations and you can see
the example commands in here.
Okay, let's get start for our example.
Open the code and in here I'm going to use an invocation logs from the our last created lambda function,
which is the ADA, which is my function to for that purpose.
We have several steps.
If you come here, you can see the first step is get the log group name.
So I'm going to get logged group name with these commands.
First of all, I would like to say that I'm using multi-line character for Windows.
If you are using the Mac or Linux, you can change these escape character with this one.
Okay, let me copy this first command and paste in here.
Hit the enter.
You can see that here.
There is some a lambda functions and get the log names in here.
I have very big list, but the idea is that we are going to check the logs for the my function tool
because we have just created this function so you can get the name from these describe log groups command.
And after that we will list the log stream for that locker room for that action.
I'm going to copy this command, which is the logs describe log stream and pasting the log name as our
function, which is the alias slash lambda slash my function to.
And here you can paste this command into the PowerShell command line window and hit enter.
So this time we will see the log stream names in here.
So after that, after we grabbing getting these log stream names, now we can get log events from the
particular logs that remain.
For that purpose, we have one more command, which is the alias logs, get the log dash events command
and we are going to pass log name as my dash function tool and logs it in the name you can copy from
the last one and paste as the log stream name.
And now we are ready to get the logs from the latest log stream name and paste the command in here.
Hit the enter.
And you can see the response is coming as expected.
If you come the latest line of code and scroll up, you can see that we have events.
El Rey.
And in these events, El Rey, we have several looks.
This is the start.
Look, as you can see that start request ID and this is the second log which is the logging, the incoming
command, you can see the increment event.
JSON is a JSON format key and value.
And if you scroll down, you can see the latest log which is the and request log.
So if you check the second look, this is the important one, you will see the incoming event JSON object.
We can also verify from the list management console cloud which logs that we can already do.
In the last video you can see that in the cloud watch logs.
We can get these logs from the commands.
As you can see that we can take a lambda invocation logs from the Amazon cloud logs using the same commands.