Viewing Local Logs

The TNSR CLI can display and filter local logs in a flexible way using the show logging command which has the following syntax:

tnsr# show logging [priority <priority>]
                   [kernel|(service <name>]|syslog-facility <name>|syslog-identifier <id>)
                   [<additional-sources>]]
                   [after-time <time>] [before-time <time>] [recent-lines <n>] [reverse]

All of the parameters are optional, using show logging on its own will display the most recent log messages from any source unfiltered.

The show logging command accepts the following optional paramters:

priority (debug|info|notice|warning|err|crit|alert|emerg):

Limits log message output to messages with the given priority level and higher. The order of priorities is as listed above. For example, if priority crit is specified, that also includes messages for alert and emerg priorities.

Sources:

Log messages may be limited by source in several ways. Limiting to kernel messages must be on its own, but other sources can be combined to view multiple sources at the same time.

kernel:

Displays the kernel system message buffer for the current boot session only, similar to the dmesg or journalctl --dmesg commands in the shell.

Tip

Use show logging syslog-identifier kernel to view the kernel system message buffer for previous boots.

service (backend|dataplane|dhcp|dns|ipsec|ntp|routing|snmp|ssh):

Limits log messages to specific TNSR service sources or “units”.

This option may be repeated for a total of up to four of these sources.

See also

Service Control

syslog-facility (auth|authpriv|cron|daemon|ftp|kern|local[0-7]|lpr|mail|news|syslog|user|uucp):

Limits log messages to only those using a specific log facility. Log sources use these facilities to describe which part of a system generated a log message.

This option may be repeated for a total of up to four of these sources.

syslog-identifier <id>:

Limits log messages to only those using a specific log identifier, which is typically the name of a program or daemon generating a message.

This option may be repeated for a total of up to four of these sources.

after-time <time>, before-time <time>:

These parameters filter output to only messages generated within a given time frame. When neither parameter is present, messages from any time can be in the output. These filters can be specified separately or together to form a specific time window for reviewing log messages.

Note

These paramters work similarly to journalctl --since time and --until time.

The <time> values can be dates, dates and times, or times in various formats, including the journalctl format: YYYY-MM-DD HH:MM:SS.

Note

  • Specifying only a date implies a time of 00:00:00

  • Specifying only a time implies log messages should be from that time in the past 24 hours.

recent-lines <n>:

Specifies the number of log lines to return. This can be either lower or higher than the default (10000). When used in the CLI, if output is longer than the terminal height, the output is paged.

Warning

Requests with large recent-lines values (e.g. 100000 lines or higher) can result in a significant delay in CLI response time. Depending on hardware this could be 5-10 seconds for 100,000 lines and several minutes for 1,000,000 lines.

reverse:

Prints the log lines in reverse order, with the most recent log messages printed first.