Examining call logs and errors

To see all call logs, use the fn calls command. Please note that it's the calls command with an s. The fn calls list command accepts the name of the application. The attributes to focus on are ID, and Status. The following example shows two call logs, the first one is error and the second one is success, in reverse chronological order:

$ fn calls list demo 

ID: 01C8VRGN9R47WGJ00000000000
App: demo
Route: /hello_go
Created At: 2018-03-18T05:15:04.376Z
Started At: 2018-03-18T05:15:04.738Z
Completed At: 2018-03-18T05:15:07.519Z
Status: success

ID: 01C8VRFE3647WGE00000000000
App: demo
Route: /hello_go
Created At: 2018-03-18T05:14:24.230Z
Started At: 2018-03-18T05:14:24.566Z
Completed At: 2018-03-18T05:14:27.375Z
Status: error

Now, we pick the second call ID to get the log messages. The command used for  retrieving logs is fn logs get. It requires the application name and the call ID:

$ fn logs get demo 01C8VRFE3647WGE00000000000
err JSON Decode: EOF

The previous log message is the one printed out to os.Stderr by the Go program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset