Redirect Legato logs to the console USB port

Hello,

I’m trying to display the logs from Legato (the output of logread) on my computer, without having to ssh on the mangOH Yellow.

I was wondering if it was possible to redirect these logs to the console USB port of the mangOH and read them on my PC with cutecom or something similar ?

So far the only thing coming from this USB port are the logs from the OS when it boots.

root@swi-mdm9x28-wp:~# cm info all
Device:                        WP7702
IMEI:                          352653090187212
IMEISV:                        4
FSN:                           4L933470110310
Firmware Version:              SWI9X06Y_02.32.02.00 c2e98c jenkins 2019/08/30 07:28:21
Bootloader Version:            SWI9X06Y_02.32.02.00 c2e98c jenkins 2019/08/30 07:28:21
MCU Version:                   002.013
PRI Part Number (PN):          9909138
PRI Revision:                  001.001 
Carrier PRI Name:              SIERRA
Carrier PRI Revision:          001.027_000
SKU:                           1104405
Last Reset Cause:              Power Down
Resets Count:                  Expected: 156	Unexpected: 0

Thank you !

Hi Paul,

As you are accessing console port, you can simply type “logread -f” to print the running Legato log there.

Or if you don’t want to login and type the command everytime, you may add below in boot script to print the log automatically…

logread -f > /dev/console &

However, reminded if too many logs print it may disturb the console and less convenient to use.
Thx

1 Like

Hi !
Thank you, your solution worked ! :slight_smile:
What do you mean when you say it might disturb the console ?

Have a good day !

Hi Paul,
Thanks for confirmation it works for you.

Just my personal experience, because I usually print log and use the console simultaneously, but sometime Legato prints many logs (especially with debug level) so I can hardly use console command…

Anyway, it depends on your use case, it would be fine if you want to dedicate that console USB for log capture (boot / legato log) and not using it as console at the same time.

Thx