Capture XML Information in the SAS Metadata Server Log

About Capturing XML Information

To assist in troubleshooting, SAS Technical Support might request that you capture generated XML entries in the metadata server log.
When clients communicate with the SAS Metadata Server to create, update, delete, or query a metadata object, information about the metadata object is represented in XML. The metadata server also uses XML entries to return information about metadata objects to clients. For example, to add a metadata object to a repository, clients use the AddMetadata method of the SAS Open Metadata Interface. One of the parameters for this method is an XML description of the object to be added. If a client requests that a table object be added, then the request includes an XML description of the table, as shown in this example:
<PhysicalTable Name="NECust" Desc="All customers in the northeast region"/>
The metadata server returns an XML string that includes the input description as well as the object ID of the new metadata object.
These XML entries can be captured in the metadata server log (or in a separate log file) and used for troubleshooting. To capture the entries, use the one of the following procedures (or a combination of these procedures) as appropriate:
Note: For more information about the call interfaces, see SAS Language Interfaces to Metadata.

Capture XML Information in the Metadata Server Log for the Current Server Session Only

If you only want to capture XML information during the current metadata server session, follow these steps:
  1. Open the Server Manager in SAS Management Console and connect to the metadata server.
  2. On the Options tab, change the settings for the IOM.JnlStrMax and IOM.JnlLineMax properties to a higher value (for example, 1000000). The parameters are explained in the following table:
    Parameter
    Explanation
    JNLSTRMAX
    Specifies the maximum journal string length. The default is 500 characters. If this parameter is omitted, a maximum of 500 characters of the XML string is logged, and the following message is appended to the XML: *truncated to 500 characters (jnlStrMax).
    JNLLINEMAX
    Specifies the maximum journal line length. The default is 1000 characters. If this parameter is omitted, a maximum of 1000 characters of the XML string is logged, and the following message is appended to the XML: *truncated to 1000 characters (jnlLineMax).
  3. On the Loggers tab, increase the logging level for the App.OMI logger to TRACE.
    The XML information will be captured in the metadata server log for the duration of the current server session, or until you return the App.OMI logger to its default level (Inherited). To avoid adverse effects on performance, you should reset the logger when you are finished capturing XML information.

Capture XML Information in the Metadata Server Log across Multiple Server Sessions

If you want to capture XML information across multiple metadata server sessions, follow these steps:
  1. Update the object server parameters in the metadata server’s configuration file as follows:
    1. Open the sasv9.cfg and sasv9_usermods.cfg files in a text editor. The files are located in SAS-configuration-directory/Lev1/SASMeta/MetadataServer.
    2. In sasv9.cfg, find the line that specifies object server parameters. The line begins with -objectserverparms (or objectserverparms for z/OS). Copy this line to sasv9_usermods.cfg.
    3. In sasv9_usermods.cfg, add JNLSTRMAX and JNLLINEMAX to the existing object server parameters. Enclose the entire list of parameters in quotation marks, as shown in the following example:
      -objectserverparms "jnlStrMax=1000000 jnlLineMax=1000000 cel=credentials"
      CAUTION:
      The typical configuration file contains more object server parameters than are shown in this example. Make sure not to delete or overwrite the existing parameters.
      You can specify different values for JNLSTRMAX and JNLLINEMAX than those that are shown in the example.
  2. Open the server’s logconfig.xml file (located in SAS-configuration-directory/Lev1/SASMeta/MetadataServer), and add the following lines:
    <logger name="App.OMI">
         <level value="trace"/>
         <appender-ref ref="IOMCALLTRACE"/>
    </logger>
    If you want to capture the XML information n a separate log file (instead of in the metadata server log), insert the following lines before the App.OMI logger element:
    <appender class="FileAppender" name="IOMCALLTRACE">
         <param name="File" value="omasrv_iomcalltrace.log"/>
         <param name="ImmediateFlush" value="true"/>
         <param name="Append" value="false"/>
         <layout>
              <param name="ConversionPattern" value="%d %-5p [%t] %c 
               (%F:%L) - %m"/>
         </layout>
    </appender>
    
    If you want, you can specify different values (for example, a different log filename) for the FileAppender parameters. For details, see the FileAppender topic in the SAS Logging: Configuration and Programming Reference.
  3. Restart the metadata server.
To avoid adverse effects on performance, you should remove the App.OMI logger from logconfig.xml and restart the server when you are finished capturing XML information.

Examples of XML Log Entries

The format of the XML that is written to the log depends on whether the request was made using the standard SAS Open Metadata Interface or using the DoRequest method.
The following is an example of a log entry for the receipt of a GetMetadataObjects request:
2010-11-06T15:37:55,815 TRACE [00000033] App.OMI.OMI.DoRequest
(CIOMomici.c:6239) - IOM CALL {compRef:5e274b0}->OMI::DoRequest():
 inString=<GetMetadataObjects><Reposid>A0000001.A0000001</Reposid>
<Type>RepositoryBase</Type><Objects/><ns>REPOS</ns>
<Flags>264</Flags><options/></GetMetadataObjects>   
The following is an example of a log entry for a response to a client request:
2010-11-06T15:37:55,815 TRACE [00000033] App.OMI.OMI.DoRequest
(CIOMomici.c:6504) - IOM RETURN 0={compRef:5e274b0}->OMI::DoRequest():
 outString=<GetMetadataObjects><Reposid>A0000001.A0000001</Reposid>
<Type>RepositoryBase</Type><Objects><RepositoryBase Id="A0000001.A510HYM9"
Name="Foundation" Access="0" Desc="" Engine="BASE" 
MetadataCreated="26Sep2010:16:12:48" MetadataUpdated="02Nov2010:18:10:37" 
Options=""
Path="C:\SAS\Config\Lev1\SASMeta\MetadataServer\MetadataRepositories\Foundation"
RepositoryFormat="11" RepositoryType="FOUNDATION"/><RepositoryBase
Id="A0000001.A5PJCXVL" Name="Custom1" Access="0" Desc="" Engine="BASE"
MetadataCreated="26Sep2010:16:14:28" MetadataUpdated="02Nov2010:18:10:37"
Options="" 
Path="C:\SAS\Config\Lev1\SASMeta\MetadataServer\MetadataRepositories\Custom1"
RepositoryFormat="11" RepositoryType="CUSTOM"/><RepositoryBase
Id="A0000001.A5FIU3O4" Name="Project1" Access="0" Desc="" Engine="BASE"
MetadataCreated="26Sep2010:16:15:53" MetadataUpdated="02Nov2010:18:10:37"
Options="" 
Path="C:\SAS\Config\Lev1\SASMeta\MetadataServer\MetadataRepositories\Project1"
RepositoryFormat="11" RepositoryType="PROJECT"/></Objects><ns>REPOS</ns>
<Flags>264</Flags><options/></GetMetadataObjects> retval=0