How To
Summary
A custom class is used in the environment. To see its debug messages, verbose logging needs to be enabled in the Developer Toolkit (DTK).
Objective
Enabling logging helps debug the custom class and understand its behavior.
Steps
(1) Create a Custom Class for e.g.:
(b) create a Service Definition under Default Groups.

(f) Add one more API by dragging the API from the component section next to the exiting API.

(i) Save the Service Definition.
package com.omoc.ibmsupport.utils;import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;import com.yantra.shared.ycp.YFSContext;
import com.yantra.yfc.log.YFCLogCategory;
import com.yantra.yfc.util.YFCException;
import com.yantra.yfs.japi.YFSEnvironment;public class IBMSupportMockTest {private static final Logger logger = LogManager.getLogger(IBMSupportMockTest.class);private static YFCLogCategory yfcLogger = YFCLogCategory.instance(IBMSupportMockTest.class);public Document getXMLFromConfigTemplate(YFSEnvironment inEnv, Document inDoc) throws YFCException {
logger.debug("Inside getXMLFromConfigTemplate method of IBMSupportMockTest class");
logger.info("Input Document: " + inDoc);logger.info("Hi, I am in IBMSupportMockTest class");logger.warn("This is a warning message from IBMSupportMockTest class");yfcLogger.debug("Inside getXMLFromConfigTemplate method of IBMSupportMockTest class: YFCLogCategory");
Document templateXML = null;
YFSContext context = (YFSContext) inEnv;
templateXML = (Document)context.getApiTemplate("getXMLFromConfigTemplate");logger.info("Template XML: " + templateXML);yfcLogger.debug("Inside getXMLConfigTempalte Output : YFSCLogCategory");return templateXML;
}
}
(2) Create a class file and then the JAR file thereafter.
(3) Use the install3rdParty utility to install the 3rd Party Jar file:
Reference: https://www.ibm.com/docs/en/order-management?topic=application-installing-third-party-jar-files
cd <devtoolkit_docker>/runtime/bin
./install3rdParty.sh yfsextn 1_0 -j /<location_of_jar_file>/<jar_file_name>.jar -targetJVM EVERY
for e.g:
./install3rdParty.sh yfsextn 1_0 -j /home/oms/myworkspace/IBMSupportMockTest.jar -targetJVM EVERY
(4) Add following properties in <devtoolkit_docker>/runtime/properties/customer_overrides.properties:
yfs.log4j2.customPackages=com.omoc.ibmsupport.utilsyfs.log4j2.customPackage.com.omoc.ibmsupport.utils.level=VERBOSE
(5) Build customization package as an InstallService-able JAR (extensions.jar) by using the devtoolkit_extensions.xml file
Reference: https://www.ibm.com/docs/en/order-management?topic=cdt-update-custom-extensions-in-containerized-developer-toolkit-environment
cd <devtoolkit_docker>/runtime/bin./sci_ant.sh -f ../devtoolkit/devtoolkit_extensions.xml export
(6) Update the existing developer toolkit environment with the generated
extensions.jar by running the following commandcd <devtoolkit_docker>/compose
./om-compose.sh update-extn /home/oms/devtoolkit_docker/extensions.jar
(7) Restart the Containers
./om-compose.sh restart
(8) Ensure that the those log4j2 properties are loaded. To verify, run the API: getServerProperties and verify that following properties appear in the XML response:
<Property Name="log4j2.customPackages" Value="com.omoc.ibmsupport.utils"/> <Property Name="log4j2.customPackage.com.omoc.ibmsupport.utils.level" Value="VERBOSE"/>
(9) In the Application Manager, go to Application Platform > Process Modeling > General Tab > Double click General under Process Types.
(a) Select Service Definitions icon from the bottom-left section of the screen.
(b) create a Service Definition under Default Groups.

(c) In the Right section of the window grab the API from the Components section and drag it over to the blank section of the window on the right.
(d) Connect the Start and API.
(e) Highlight API component and select Standard API radio button and select API from the list. For e.g. getItemList

(f) Add one more API by dragging the API from the component section next to the exiting API.
(g) Connect both the APIs component and connect the newly added API to the End.
(h) Highlight the newly added "API" component, select "Extended API" radio button, enter APIName as "IBMSupportTest", Class Name as "com.omoc.ibmsupport.utils.IBMSupportMockTest" and Method Name as "getXMLFromConfigTemplate"

(i) Save the Service Definition.
(10) To test the custom class logging, open the IBM HTTP Tester and run the modifyTraces API to put the Service in Verbose mode for eg:
<Traces>
<Trace Action="ADD" Level="VERBOSE" Name="IBMSupportMockTest" Type="FLOWS"/>
</Traces>
(11) Open another session of IBM HTTP Tester
(a) select the CheckBox "Is a Service" and specify Service Name as "IBMSupportMockTest".
(b) Selet getItemList from the API Name dropdown and enter request XML for e.g:
<Item ItemID="100014"> </Item>
(c) Click the "Test API Now!" button
(12) Check the sci.log in the om-appserver container.
(a) docker exec -it om-appserver bash
(b) cd /opt/ssfs/runtime/logs
(c) vi sci.log
(d) Locate the entries for debugging statements from the IBMSupportMockTest class for e.g:
2025-05-14 09:17:28,767:DEBUG :Default Executor-thread-287: Inside getXMLFromConfigTemplate method of IBMSupportMockTest class []: []: []: IBMSupportMockTest
2025-05-14 09:17:28,767:INFO :Default Executor-thread-287: Input Document: [#document: null] []: []: []: IBMSupportMockTest
2025-05-14 09:17:28,767:INFO :Default Executor-thread-287: Hi Bro, I am in IBMSupportMockTest class []: []: []: IBMSupportMockTest
2025-05-14 09:17:28,767:WARN :Default Executor-thread-287: This is a warning message from IBMSupportMockTest class []: []: []: IBMSupportMockTest
2025-05-14 09:17:28,767:DEBUG :Default Executor-thread-287: Inside getXMLFromConfigTemplate method of IBMSupportMockTest class: YFCLogCategory [system]: [d358c632-f801-4e1b-b5ec-cf452a2c4745]: [ ]: IBMSupportMockTest
2025-05-14 09:17:28,767:INFO :Default Executor-thread-287: Template XML: null []: []: []: IBMSupportMockTest
2025-05-14 09:17:28,768:DEBUG :Default Executor-thread-287: Inside getXMLConfigTempalte Output : YFSCLogCategory
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management System Software"},"ARM Category":[{"code":"a8m0z000000cy0AAAQ","label":"Install and Deploy"}],"ARM Case Number":"TS018855839","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.0.0;9.0.0;9.1.0;9.2.0;9.2.1;9.3.0;9.4.0;9.5.0"}]
Product Synonym
oms; sterling order management;
Was this topic helpful?
Document Information
Modified date:
16 May 2025
UID
ibm17233728

