sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[201911][show] show logging CLI support for logs stored in tmpfs

Open mihirpat1 opened this issue 1 year ago • 0 comments

Signed-off-by: Mihir Patel [email protected]

Backport of #2641

ADO - 16810429

What I did

Enabling "show logging" CLI to show logs from tmpfs if it exists.

How I did it

Added a check in the CLI handler to see if the path "/var/log.tmpfs" exists and display the logs from this directory if it exists. In case if the path doesn't exist, logs will be displayed from "/var/log"

How to verify it

Following tests were performed:

  1. "show logging" o/p when syslog resides in "/var/log"
  2. "show logging -f" o/p when syslog resides in "/var/log"
  3. "show logging" o/p when syslog resides in "/var/log.tmpfs"
  4. "show logging -f" o/p when syslog resides in "/var/log.tmpfs"

For detailed test results, please refer to Unit-test_logging_cli.txt

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

mihirpat1 avatar Jan 24 '24 19:01 mihirpat1