shmlog (Shared Memory Log)
Syntax
shmlog { disable; file filename <files maximum-no-files> <size maximum-file-size>; filtering enable; log-name { all; logname { <brief | detail | extensive | none | terse>; <file-logging |no-file-logging>; } } log-type (debug | info | notice); |
Hierarchy Level
[edit system services subscriber-management overrides]
Description
Junos OS uses a shared memory space to store log entries for subscriber service daemons including jpppd, jdhcpd, jl2tpd, autoconfd, bbe-smgd, authd, cosd, and dfwd. Shared memory logging is enabled by default and occurs at the client level. You can view the shmlogs on a per subscriber basis, or use filters to retrieve logs according to a variety of different parameters such as interface name, IP address, session ID, subnet, and VLAN in addition to the Client Identifier or Client DUID. Filtering is disabled by default. To see a complete list of supported filters, use this command:
user@rdevice> show shmlog entries logname all ?
When viewing logs you can limit results on the basis of event flags that include interface events, routing process interaction events, l2tp tunneling events, and ldap authentication events. To see a complete list of supported flags, use this command:
user@rdevice> show shmlog entries logname all flag-name ?
Some platforms other than MX Series routers use shared memory logs for internal processes. These logs are not intended for customer use.
Options
disable | Name of the command to override the default behavior. Use this option to disable shared memory logging; it is always enabled otherwise. |
file | Name of the file containing the shmlogs. Use this option to redirect shmlogs to a file for file-based logging. Specify the file name, define the number of files (from 2 to 1000), and set the maximum file size (from 10240 to 1073741824 bytes). Data will be written to the /var/log/shmlog/ directory. Files follow this naming convention: <cfg-file-name>-<daemon>-<severity>.log. The shmlog files are not human-readable, so to access the logs you must first run the following command to generate a file in the /var/log/<file-name>/ directory with logs from all daemons: user@rdevice> show shmlog entries filename /var/log/shmlog/<file-name>* logname all If you then want to view logs from a specific daemon, you need to run the following command to generate a file under the /var/log/<file-name>/ directory with complete logs: user@rdevice> show shmlog entries filename /var/log/shmlog/<filename> logname authd* |
filtering | Command to enable filtering. Filtering is subscriber centric and is useful for debugging and troubleshooting. It is disabled by default so you must use this option to enable it. For example, if you want to quickly view the transmit packet logs for subscribers with interface-name pp0.100, you could use the following command to display only the relevant results: user@rdevice> show shmlog entries logname jpppd* interface-name pp0.100 flag transmit-packets To debug sessions according to the interface name, use this command: user@rdevice> show shmlog entries logname all interface-name pp0.100 To debug sessions that are logging in via VLAN 7 on physical-interface ge-0/0/0, use this command: user@rdevice> show shmlog entries logname all vlan 7 physical-interface ge-0/0/0 |
log-name | Name of the file containing the log output. Use this option to override all logs or a specified log, and to set the verbosity level (brief, detail, extensive, none, or terse). For example, to configure bbe-autoconf-info for detailed file logging, you would use the following command: user@rdevice> [edit system services subscriber-management overrides shmlog] user@rdevice> set log-name bbe-autoconf-info detail file-logging |
log-type | Severity level of the collected logs. Use this option to configure the severity level for captured logs (notice, info, or debug). |
Required Privilege Level
system—To view this statement in the configuration.
system-control—To add this statement to the configuration.
Release Information
Statement introduced in Junos OS Release 16.2.