Show TOC

Procedure documentationSetting Up SAP Gateway Logging Locate this document in the navigation structure

 

SAP gateway logging is used to monitor the activities of the SAP gateway. You can configure which SAP gateway actions are to be 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.

Procedure

You can set up the logging in profile parameter gw/logging or in the gateway monitor (transaction SMGW). We recommend the following configuration for the gateway monitor.

Note Note

The gateway monitor is not available, if you are using a standalone gateway or a Java-only installation. You then have to configure the gateway monitor in parameter gw/logging.

More information: Configuration Parameters

End of the note.
  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 setttings and their changes (reloading files).

    More information: Security Settings in the SAP Gateway

    S

    Rejected accesses only

    Only rejected actions are logged in the log file. This keeps the log file small. This can make administration tasks easier, for example, analysing data.

    s

    Rejected accesses without rules

    Rejected accesses that are not listed in the reginfo file nor in the secinfo file are logged in the log file.

    Z

    Monitor commands

    Administration command that the gateway receives from the gateway monitor (SMGW or externally gwmon)

    M

    Dynamic parameter changes

    Changes profile parameters in productive operation

    More information: Parameterization of the SAP Gateway

    P

    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

    Launching of external programs.

    More information: Making Security Settings for External Programs

    E

    Registered programs

    Registration and deregistration of servers.

    More information: Making Security Settings for External Programs

    R

    Create/delete Conversation IDs

    Creates new conversation IDs, deletes conversation IDs

    V

  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. Choose whether all programs are to be allowed by default or not (simulation mode = On).

    In the default (security mode = Off) all rules in the security files are processed, and all connections not explicitly listed are rejected.

    In the simulation mode all the rules in the security files are processed too, and furthermore, all connections not explicitly included in the security files are allowed. This function can support you with Logging-Based Configuration of SAP Gateway.

  7. Select Activate (Activate) to accept your settings.

Caution Caution

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

End of the caution.

Recommendation Recommendation

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.

End of the recommendation.

Result

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 (Display File).

Example

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-10 with 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

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)

S Wed Oct 10 2007 11:13:40:177 secinfo denied: USER=rehm, USER-HOST=ld8400.wdf.sap.corp (10.21.80.16), HOST=ld8400.wdf.sap.corp (10.21.80.16), TP=/priv/rehm/p4/bas/CGK/workU/_out/cpict2

S Wed Oct 10 2007 11:13:40:277 reginfo denied server: TP=cpict2, HOST= ld8400.wdf.sap.corp (10.21.80.16)

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