Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous section

Enabling Logging in ISCLOG

Enabling Logging in ISCLOG

To troubleshoot CSP issues, enable logging for Caché by entering the following command in the Terminal:

 Set ^%ISCLOG = 2
Copy code to clipboard

You can view logging information in the ^ISCLOG global. This global logs events in Caché for use in debugging. For reference, the log levels are as follows:

  • 0 — Caché performs no logging.

  • 1 — Caché logs only exceptional events (such as error messages).

  • 2 — Caché logs detailed information, such as method ABC invoked with parameters X,Y,Z and returned 1234.

  • 3 — Caché logs raw information such as data received from an HTTP request.

You can turn Caché logging off with either

 Set ^%ISCLOG = 0
Copy code to clipboard

or

 Kill ^%ISCLOG
Copy code to clipboard

In ISCLOG, some entries match Event Log header fields as follows:

ISCLOG Event Log
Job Cache-PID
SessionId Session-ID
Tag Request-ID

Fields and definitions in ISCLOG are shown in the table below.

ISCLOG Fields
Field Definition
%category
CSPServer: Logged from cspServer, cspServer2, %request, %response.
 
CSPSessionLogged from %session and parts of cspServer and cspServer2 which handle a session. This allows watching the lifecycle of a session.
 
CSPLicenseLogged from parts of cspServer and cspServer2 which handle a licensing.
 
Gateway RequestLogged from the GatewayMgr, GatewayRegistry, the Gateway request handler and parts of cspServer2 which handle gateway requests.
%level
1= Exceptions and errors.
 
2=CSPSession information. CSPLicense information. Information from cspServer: the part of the request handling after the %response, %session, and %request have been setup. This includes authentication, license handling, redirection, and calling the CSPpage.
 
3=Information from cspServer2: the part of handling the request which sets up the %response, %session, %request, and hand-shaking/data transfer with the CSP Gateway.
%job The value of $job when the ISCLOG request was made. Matches the Cache-PID field from the Event Log header.
%sessionid
Entered when available. The value of sessionid at the time the ISCLOG request was made. Matches the Session-ID field from the Event Log header.
%tag For the CSP Server, the tag contains the Request id from the gateway (when available). This matches the Request-ID field from the Event Log header. Other loggers may set this value to any value.
Available for use by creators of ISCLOG entries. Stores ID of the request sent to it by the CSP Gateway. It can be used as a filter for generation of ISCLOG entries.
Set ^%ISCLOG("Tag","mytagvalue1")=1 Set ^%ISCLOG("Tag","mytagvalue2")=1
Only ISCLOG requests with no tag or with tags of "mytagvalue1" or "mytagvalue2" will be recorded.
%routine The name of the routine currently being executed.
%message See the sectionMessage Format below.

Message Format

Messages start with the name of the tag label or method currently being executed. This name is enclosed in square brackets. [MyMethod] rest of messages.

Messages in the CSPSession category also have CSPSession-Id=sessid after the method name. This is needed as session events can be logged before the session is created or after it was destroyed, meaning the SessionId field is empty in the ISCLOG entry.

[MyMethod] CSPSession-Id: 12ty34ui22
Copy code to clipboard

Messages in the GatewayRegistry category also have CSPID=cspid(when available) after the method name. This allows the tracking of an individual gateway request from the API call through the Gateway Request Handler.

 [MyMethod]CSPID:334r43345 rest of message
Copy code to clipboard
FeedbackOpens in a new window