Transaction code SM21 is used in SAP systems for system logs analysis. T-code SM21 provides a centralized view of system log data, allowing SAP administrators to monitor system events, identify issues, and troubleshoot problems. The system logs in SAP contain information about all system errors, warnings, process messages, and user locks resulting from failed logon attempts by known users.
Using t-code SM21, SAP administrators can view logs for specific time periods, filter by log types such as error, warning, or information, and export logs for further analysis. Additionally, t-code SM21 provides various tools for analyzing logs, such as filtering by specific keywords or log messages, allowing administrators to quickly pinpoint issues and take appropriate action.
How to Perform System Log Analysis using t-code SM21?
Performing system log analysis using t-code SM21 in SAP GUI involves the following steps:
Execute t-code SM21 in the SAP Command field.
Or in the SAP Easy Access menu, navigate to the following path
Tools > Administration > Monitor> System Log
Now in the Display the system log screen, select the appropriate Date Range and Log Types to display in the log view.
Enter Extended attributes details according to your requirements.
Now click on the Execute button to proceed.
Next use the filter options to narrow down the log entries by message type, server name, or other relevant criteria.
Review the log entries to identify any errors, warnings, or other issues that require further investigation.
The user can Export the log entries if necessary for further analysis or to share with other team members.
Take appropriate actions based on the findings, such as resolving errors, investigating security breaches, or optimizing system performance.
Note: SAP Users can regularly review the system logs using t-code SM21 to proactively identify and address any issues before they become more significant problems.
Types of Logs in T-code SM21
The list of logs in t-code SM21 can be filtered based on three categories:
- Problems Only
- Problems and Messages
- All Messages
Errors are indicated with a red sign under Priority, and the T-code used by the user during the error can also be identified. The SAP system log creates two types of logs:
Each SAP System application server has its own local log that records all the messages output by the server. The system log saves these messages in a circular file on the server, overwriting it when it reaches the maximum permissible length. The location of the local log is defined by the rslg/local/file profile parameter.
Each application server sends its local log messages to the designated central log server, which collects and records these messages to the central log. The central log consists of two files: the active file and the old file. The active file contains the current log and the old file contains the previous log. The location of the active and old files is defined by the rslg/central/file and rslg/central/old_file profile parameters, respectively.
When the active log file reaches its maximum size, the system performs a log file switch. It deletes the old log file, designates the previously active file as the "old" file, and creates a new active file. The switch occurs when the active log file reaches half the value specified in the rslg/max_diskspace/central parameter.