How to use sectionctl to stream Node.Js pod logs Follow
First, find the running Node JS pods on an application.
💖❯ sectionctl ps --account-id=1984 --app-id=20211
❮ 1
Getting status of apps... ✔️
|------------|--------|-----------------------------|------------|--------------------------------------|
| ACCOUNT ID | APP ID | APP INSTANCE NAME | APP STATUS | APP PAYLOAD ID |
|------------|--------|-----------------------------|------------|--------------------------------------|
| 1984 | 20211 | nodejs-fb6c6f4f5-8q95v-5mv | Running | 39121e9f-1658-43e1-8f6d-3e31ac45c540 |
| 1984 | 20211 | nodejs-5648f85c54-t47p5-5e3 | Running | 39121e9f-1658-43e1-8f6d-3e31ac45c540 |
|------------|--------|-----------------------------|------------|--------------------------------------|
Next, you follow logs by selecting a pod.
sectionctl logs --account-id=1984 --app-id=20211 --instance-name=nodejs-fx7shsx8-8q95v-5mv --follow
InstanceName[Log Type] Log Message
nodejs-7c66cd8d5b-trhsw-5e3[access] {"time":"2021-06-03T19:00:30+00:00","request":"GET /enterprise?1234345 HTTP/1.1","host":"www.section-demo.net","section_io_id":"75c0c3c29b958df0fd4c0af3a05d4dd1","status":"200","time_taken_ms":"0.087","bytes":"7126","content_type":"text/html; charset=UTF-8","protocol":"https"}
nodejs-7c66cd8d5b-trhsw-5e3[access] {"time":"2021-06-03T19:03:38+00:00","request":"GET /enterprise?10987654321 HTTP/1.1","host":"www.section-demo.net","section_io_id":"16fd8e806c1aee1d3298a2f8f24baf59","status":"200","time_taken_ms":"0.008","bytes":"7126","content_type":"text/html; charset=UTF-8","protocol":"https"}
Comments
0 comments
Article is closed for comments.