Gateway logging is used to monitor the activities of the gateway. You can configure which gateway actions are logged. They are then written to a log file. The log file is named after its creation time stamp, but you can configure its exact format.
You can set up logging of the profile parameters gw/logging (see Configuration Parameters), or you can use the gateway monitor (transaction SMGW). We recommend the following configuration for the gateway monitor.
More information: Using SAP Gateway Monitor in SAP System
...
1. Call the gateway monitor (from the menu or in transaction SMGW)
2. Choose Goto → Expert Functions → Logging.
3. Define a name for the log. To do this enter a name in the File Name field where you can set the specified time stamp variables. The default setting is gw_log-%y-%m-%d. The file will then be called gw_log-2007-06-19.
4. Choose the gateway actions that you wan to log in the log file. You can select the following types of gateway actions:
Gateway Action |
Description (actions logged) |
Indicator in the Log File |
Network |
Network actions, opening and closing network connections |
T |
Start/stop/signals |
Receipt of start and stop commands or other (operating system) signals |
X |
Security |
Security setting and their changes (file reload), see Security Settings for the SAP Gateway |
S |
Monitor commands |
Administration command that the gateway receives from the gateway monitor (SMGW or externally gwmon) |
M |
Create/delete Conversation IDs |
Creates new conversation IDs, deletes conversation IDs |
V |
Open RFC connection |
Creates new RFC connections |
O |
RFC actions (open/close/send/receive) |
RFC actions: Opens and closes connections, sends and receives data |
C |
External Programs |
Starts external programs (see Assigning Start Authorizations for External Programs) |
E |
Registered programs |
Registration and deregistration of servers (more information: Registration Authorizations for External Programs |
R |
Dynamic parameter changes |
Changes profile parameters in productive operation |
P |
5. Choose the Toggle Criteria (in the lower section of the screen). You can configure the following:
○ Time-Controlled Toggle: You can specify a time period after which a new file is opened. Possible values are no toggle, and toggle after one hour, one day, or one year.
○ Maximum File Size (kByte): You can set the maximum size of the file (specified in kilobytes). If the log file exceeds this size, the file is closed and a new one opened. A new file name is assigned provided you use the timestamp variables when you name the file (see above).
○ Specify Old File: You select this checkbox to prevent a new file being created. The old file is then overwritten when the time-controlled toggle condition is applied or when the maximum file size is exceeded.
6. Select Activate to accept your settings.
The settings you make here are saved in the shared memory of the instance. They are retained when the gateway is restarted. However, if the whole instance is closed down, the settings are lost. If you want to make general logging settings, you have to set parameter gw/logging in the profile file.
More information: Configuration Parameters
The log file is created, and further files are written depending on the settings. The files can be found in the work directory of the instance.
You can see existing log files at the top next to the name of the log file. To look at the file, choose Display File.
If you select gateway actions Start/Stop/Signals, Security and Dynamic Parameter Changes for logging, and you use the standard setting for the file name, you will get, for example, file gw_log-2007-10-10with the following content:
P Wed Oct 10 2007 11:07:19:891 trace file opened P Wed Oct 10 2007 11:07:19:891 change gw/logging from ACTION= LOGFILE=gw_log-%y-%m-%d SWITCHTF=day MAXSIZEKB=100 => ACTION=SPX LOGFILE=gw_log-%y-%m-%d SWITCHTF=day MAXSIZEKB=100 P Wed Oct 10 2007 11:07:19:891 change gw/logging from ACTION= LOGFILE=gw_log-%y-%m-%d SWITCHTF=day MAXSIZEKB=100 => ACTION=SPX LOGFILE=gw_log-%y-%m-%d SWITCHTF=day MAXSIZEKB=100 S Wed Oct 10 2007 11:07:38:196 reginfo accepted server: TP=cpict2, HOST=ld8060.wdf.sap.corp (10.66.66.90) S Wed Oct 10 2007 11:08:14:974 reginfo accepted server: TP=IGS.WDFD00146227A, HOST=wdfd00146227a.dhcp.wdf.sap.corp (10.18.94.4) S Wed Oct 10 2007 11:08:20:103 secinfo accepted: USER=rehm, USER-HOST=ld8060.wdf.sap.corp (10.66.66.90), HOST=ld8061.wdf.sap.corp (10.66.66.91), TP=/usr/sap/BIN/SYS/exe/run/tp S Wed Oct 10 2007 11:09:00:497 secinfo accepted: USER=rehm, USER-HOST=ld8060.wdf.sap.corp (10.66.66.90), HOST=ld8061.wdf.sap.corp (10.66.66.91), TP=/usr/sap/BIN/SYS/exe/run/tp S Wed Oct 10 2007 11:09:19:974 reginfo accepted server: TP=IGS.WDFD00146227A, HOST=wdfd00146227a.dhcp.wdf.sap.corp (10.18.94.4) S Wed Oct 10 2007 11:10:24:975 reginfo accepted server: TP=IGS.WDFD00146227A, HOST=wdfd00146227a.dhcp.wdf.sap.corp (10.18.94.4) S Wed Oct 10 2007 11:11:04:780 secinfo accepted: USER=REHM, USER-HOST=ld8061.wdf.sap.corp (10.66.66.91), HOST=ld8061.wdf.sap.corp (ld8061) (10.66.66.91), TP=/usr/sap/BIN/SYS/exe/run/tp S Wed Oct 10 2007 11:11:29:976 reginfo accepted server: TP=IGS.WDFD00146227A, HOST=wdfd00146227a.dhcp.wdf.sap.corp (10.18.94.4) S Wed Oct 10 2007 11:11:34:347 secinfo accepted: USER=REHM, USER-HOST=ld8061.wdf.sap.corp (10.66.66.91), HOST=ld8061.wdf.sap.corp (%%SAPGUI%%) (10.66.66.91), TP=gnetx.exe S Wed Oct 10 2007 11:11:55:536 secinfo accepted: USER=REHM, USER-HOST=ld8061.wdf.sap.corp (10.66.66.91), HOST=ld8061.wdf.sap.corp (ld8061) (10.66.66.91), TP=sapxpg S Wed Oct 10 2007 11:12:06:166 secinfo accepted: USER=REHM, USER-HOST=ld8061.wdf.sap.corp (10.66.66.91), HOST=ld8061.wdf.sap.corp (ld8061) (10.66.66.91), TP=sapxpg S Wed Oct 10 2007 11:12:34:977 reginfo accepted server: TP=IGS.WDFD00146227A, HOST=wdfd00146227a.dhcp.wdf.sap.corp (10.18.94.4) P Wed Oct 10 2007 11:13:21:871 change gw/cpic_timeout from 120 => 121 S Wed Oct 10 2007 11:13:39:977 reginfo accepted server: TP=IGS.WDFD00146227A, HOST=wdfd00146227a.dhcp.wdf.sap.corp (10.18.94.4) X Wed Oct 10 2007 11:14:15:900 received signal SIGUSR1 (decrement trace, level=0) X Wed Oct 10 2007 11:14:24:033 received signal SIGUSR2 (increment trace, level=1) P Wed Oct 10 2007 11:14:34:523 trace file closed |
You can set the profile parameter as follows:
gw/logging=ACTION=SPX LOGFILE=gw_log_$(SAPSYSTEMNAME)_$(SAPLOCALHOST)-%y&m%d SWITCHTF=day .
Then signals, profile parameter changes, and security actions will always be logged, and if required, you can also extend the logging as described above.