View Connector logs
Logs are useful for troubleshooting problems related Magento Commerce and the Order Management System (OMS) Connector.
Magento-specific logs are in the <magento-root-dir>/var/
directory. See Magento Logging in the Configuration guide.
Viewing logs
There are three ways to view logs: file system, project web UI, or the magento-cloud Command Line Interface (CLI):
- Log directories—The
/var/log
system directory contains logs for all environments. Thevar/log/
Magento directory contains app-specific logs unique to a particular environment. You must use an SSH connection to access logs in a remote server environment. - Project web UI (Cloud only)—You can see
build
andpost-deploy
log information in the environment messages list. - Magento Cloud CLI (Cloud only)—You can view logs using the
magento-cloud
log command.
In the var/log/mcom-connector.log
log file all the internal Connector messages will be logged in this format:
[YYYY-MM-DD HH:MM:SS] mcom.<LEVEL>: <OMS-MODULE>: <MESSAGE>
Information in the log messages include:
LEVEL
—Message severity (ERROR
,INFO
,DEBUG
,WARNING
, etc.)OMS-MODULE
—Name of Connector module which logged the message (such asCatalogMessageBus
)MESSAGE
—Log text
Example of log messages
[2017-03-01 07:56:12] mcom.DEBUG: AmqpMessageBus: Finish consuming message {"consumer":"stockConsumer","queue":"stock-consumer","topic":"magento.inventory.aggregate_stock_management.updated","message_id":"344764782367297","status":"FAILED","result":"Message code 1e1e30153de28bfa562e17d876d70070 already processed"} []
[2017-03-01 07:56:43] mcom.INFO: CatalogMessageBus: Event for product #1 sent to message bus [] []
[2017-03-01 08:04:35] mcom.ERROR: InventoryMessageBus: Inventory Stock Update : 'Requested stock Aggregate doesn't exist' [] []
[2017-03-01 08:38:22] mcom.DEBUG: CatalogMessageBus: Export Catalog Task Started. [] []
[2017-03-01 08:38:23] mcom.DEBUG: CatalogMessageBus: Start export requested at 2017-03-01 08:38:00 [] []
[2017-03-01 08:38:38] mcom.DEBUG: CatalogMessageBus: ERROR : Export cancelled by user [] []
[2017-03-01 08:38:38] mcom.DEBUG: CatalogMessageBus: 50 products exported [] []
[2017-03-01 08:38:38] mcom.DEBUG: CatalogMessageBus: Export Catalog Task Finished. [] []
See Log locations more information.
Available logs
See the following sections to learn about the available logs you can access to troubleshoot your Connector.
Error tracing
Since Magento on a Cloud environment only works in Production mode, error tracing is not visible in your browser, but you will see the number of error record items. The log file for a specific error record item (with a name matching the error record item) is in the var/report/
directory. You can view the content there using SSH access to the Cloud.
System actions and message processing
You can find errors related to system actions and message processing on both the Connector and the OMS sides, in their respective file system locations.
The Connector uses the following logs in var/log/
:
exception.log
—Exceptions are logged here.connector.log
andmcom-connector.log
—Actions connected with outgoing messages to the OMS and related statuses, such as for product or order exports are logged here.
You can also view message processing errors in New Relic, if that integration is enabled.
See the Commerce logs and OMS logs sections to learn how to access logs for each.
Commerce logs
You can view the Commerce messaging process logs for the Connector in the Magento Commerce Admin. See the View message processing logs section of the Message Log user guide topic for more information.
OMS logs
To view message processing logs for all your OMS integrations:
- Log into the OMS Admin.
-
Click System in the menu, then click API Journal in the Events section.
System > API Journal
- Click Show filters to add any search criteria you want to employ, such as Endpoint and Status.
- Click Apply to see your query results.
-
Click View for the message you want to see view. The Details view for that message appears, including information errors, latency, and more.
Details view for a message in the API Journal
Incoming and outgoing messages
To view incoming and outgoing messages related to orders:
- Log into the OMS Admin.
-
Click Sales in the menu, then click Orders in the Operations section.
Sales > Orders
- Click an order in the Order ID column to open it. The Order details view appears.
- Click External in the left-hand menu of the Order details view. In a grid on the right half of the screen you can see all messages connected with the order.
-
Click the topic/message name in the Tag column to view the message’s body.
Click topic/message in Tag column to see message body
Message performance
You can see performance measurements of each message as they are processed. Access information about which messages may be causing performance problems, either via New Relic or inside the var/log/mcom-connector.log
log file, so that you can quickly diagnose and fix issues.
See the user guide to learn how to enable message performance logs for the Connector.
Metrics available out-of-the box for each transaction include:
- Memory usage before the message is processed
- Memory usage after the message is processed
- Difference between memory usage before and after the message is processed
- Peak memory usage before the message is processed
- Peak memory usage after the message is processed
- Difference between peak memory usage before and after the message is processed
- Time elapsed
Example log file of message performance measurements
[2020-03-06 19:24:06] mcom.DEBUG: ServiceBusPerformanceMonitor: "Profile information for ServiceBus SingleMessageProcessor": {
"messageId": "905",
"messageLogId": "1218",
"messageMethod": "magento.inventory.aggregate_stock_management.updated",
"messageDeliveryId": "ace3d531-a0dd-4296-86e6-45f233cbd135",
"messageSize": "243071 B",
"memoryUsageBefore": "188060576 B",
"memoryUsageAfter": "189762752 B",
"memoryUsageDelta": "1702176 B",
"peakMemoryUsageBefore": "213910864 B",
"peakMemoryUsageAfter": "213910864 B",
"peakMemoryUsageDelta": "0 B",
"wallTimeBefore": "2020-03-06T19:24:05.304600",
"wallTimeAfter": "2020-03-06T19:24:06.840300",
"wallTimeElapsed": "1.5356369018555 s",
"userTimeBefore": "1.420413 s",
"userTimeAfter": "2.871296 s",
"userTimeElapsed": "1.450883 s",
"systemTimeBefore": "0.241047 s",
"systemTimeAfter": "0.24654 s",
"systemTimeElapsed": "0.005493 s"
}
Deployment errors
For Cloud environments, you can find deployment errors in your Git console (after you git push
) or using the Project Web UI, where you can find the logs for each Cloud upgrade task.
See Log locations for more information.