Console.log() output not in logread unless costly logging is enabled

The log output is not present in syslog/logread output unless logging is enabled, which is costly and undesired. For example, several logs are output in edge actions:
After a reboot with logs DISABLED, logs are not present:

root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# logread | egrep "(action_id)"
root@swi-mdm9x28-wp:~#

When logging is enabled, see the result of enabling logs. Rebooting with logs ENABLED result in the desired EA logs being output to syslog as desired:

root@swi-mdm9x28-wp:~# logread | egrep "(action_id)"
May 22 11:46:40 swi-mdm9x28-wp user.info Legato:  INFO | cloudInterface[1286]/cloudcomp T=main | operation.c RunSetDefaultValue() 431 | admin_SetJsonDefault("/app/diagnostic/logs/filter", "[{"app":"actions","level":"INFO","pattern":"action_id"}]")
May 22 11:46:40 swi-mdm9x28-wp user.info Legato:  INFO | cloudInterface[1286]/cloudcomp T=main | operation.c RunPushValue() 391 | admin_PushJson("/app/diagnostic/logs/filter",0, "[{"app":"actions","level":"INFO","pattern":"action_id"}]")
May 22 11:46:40 swi-mdm9x28-wp user.info Legato:  INFO | diagnostic[1311]/components T=main | diag.c diag_LogFilterChangeHandler() 825 | Received filters: [{"app":"actions","level":"INFO","pattern":"action_id"}]
May 22 11:46:40 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l64681f3c6cfd23659602d9ee | "*** ulpm_uptime timer count changed *** - now: 0"
May 22 11:46:40 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l644ad81318387d225c9fda75 | "bootup timer count changed - now: 0"
May 22 11:46:42 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l644ad81318387d225c9fda75 | "bootup timer count changed - now: 1"
May 22 11:46:42 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l644ad81318387d225c9fda75 | "starting ulpm_up_timer (only on boot timer val=1) "
May 22 11:46:42 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l644ad81318387d225c9fda75 | "getting current time for reference "
May 22 11:46:42 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l644ad81318387d225c9fda75 | "current time at bootup: 052223 11:46:42.024"
May 22 11:46:42 swi-mdm9x28-wp user.info Legato:  INFO | actions[1233]/actionRunner T=Javascript | actionRunner_JS.c js_LogInfoHandler() 1313 | action_id:l64681f3c6cfd23659602d9ee | "*** ulpm_uptime timer count changed *** - now: 0"
root@swi-mdm9x28-wp:~#

The logs used to be output to syslog without costly diagnostic logs being enabled. Can I get information regarding how to obtain these logs without enabling diagnostic logs?

Hi,
Maybe this thread can help you.

/Jes

Hi @dpinc
While I don’t reproduce the behavior you mention (see my answer in Edge Action logs no longer available in syslog, I can see the console logs without enabling logs),
you can suppress the push of diagnostic logs by removing the logs observation after having enabled the logs.


Regards,
Nicolas

Thanks for the update and feedback. I think the issue I am encountering is related to the configuration (mis-configuration ?) of log filters.

I found that the toggling Diagnostic Mode via the Device Drop down enabled the logs until the next reboot. It appears that doing so causes /app/diagnostic/logs/filter to be pushed.

The settings apparently are not persistent. The next boot, the logs are once again not output. Checking the Resources settings, the logs filter is empty (i.e. ).

In syslog, this is flagged as a WRN level trace:

May 31 12:00:53 swi-mdm9x28-wp user.warn Legato: -WRN- | configMonitor[1283]/configMonitor T=main | configMonitor.c cloud_cm_ReportConfigStatus() 170 | '/app/diagnostic/logs/filter' handler returned LE_FORMAT_ERROR

Even though diagnostic logs are disabled, manually copying and pasting the log filters set when logging is enabled to the configured diagnostic/logs/filter seems to enable the logs again.

[{"app":"actions","level":"INFO","pattern":"action_id"}]

The console logs appear to be persistent and survive the reboot.

However, if Diagnostic Mode is once again toggled via the Device Drop down at this point the filter settings are once again cleared resulting in logs no longer being output (after reboot) and the filter error warning returning.

Could I get some instruction on the reproducibility of this issue and the correct configuration of /apps/diagnostic so that the console logs are reliable output and not disabled by toggling diagnostic mode?

Thanks.