Requests and API calls Logging in the Commerce Connector

  • 22 December 2021
  • 1 reply
  • 168 views

Userlevel 7
Badge +3
  • Acumatica Commerce Edition Team Lead
  • 227 replies

Hi All,

 

Acumatica BigCommerce and Shopify connectors (as well as others connectors build on the Commerce frameworks) have ability to collect verbose diagnostic logs. 

By default, the logging functionality is switched off to keep performance up, but on the development instances it can be enabled. You have 2 ways - logs in files and request profiler.

 

File Logging

Logging is based on the Serilog, so it has to be enabled vin the web.config file with the following appSettings instructions.

<appSettings>
..............
<add key="serilog:minimum-level" value="Verbose" />
<add key="serilog:using:File" value="Serilog.Sinks.File" />
<add key="serilog:write-to:File.path" value="[ACUMATICA SITE PATH]\Site\App_Data\main-.clef" />
<add key="serilog:write-to:File.rollingInterval" value="Day"/>
<add key="serilog:write-to:File.formatter" value="Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact" />
<add key="serilog:write-to:File.shared" value="true"/>
..............
<appSettings>

NOTE 1: Please note that you need to change [ACUMATICA SITE PATH] to the actual folder where your Acumatica is installed.

NOTE 2: logging will tons of the information into the file, so it may affect performance and consume space on the server. I recommend to enable the logging only for 1 day, after the day, please remove the logging back.

NOTE 3: applying these changes will restart the site.

When it is done, you will be able to open file main-*.clef in the notepad or notepad++. Search for messages tagged with [commerce], like the message below. You can find there useful information such as Order ID, objects data, time and operations. and some other.

{"@t":"2021-12-22T22:01:07.6246840Z","@mt":"{CommerceCaption}: BigCommerce REST API - Getting by ID {EntityType} entry with parameters {UrlSegments}","@l":"Verbose","CommerceCaption":"[commerce]","EntityType":"PX.Commerce.BigCommerce.API.REST.OrderRestDataProvider","UrlSegments":"id=297;","Scope":"OrderRestDataProvider","ContextUserIdentity":"admin","ContextScreenId":"BC301000"}
{"@t":"2021-12-22T22:01:07.8018820Z","@mt":"{CommerceCaption}: BigCommerce REST API - Getting of {EntityType} entry with parameters {UrlSegments}","@l":"Verbose","CommerceCaption":"[commerce]","EntityType":"PX.Commerce.BigCommerce.API.REST.OrderProductsRestDataProvider","UrlSegments":"parent_id=297;","Scope":"OrderProductsRestDataProvider","ContextUserIdentity":"admin","ContextScreenId":"BC301000"}

 

Request Profiler

Some of these information is also available in the Request Profiler, you log events in verbose mode.

Luckily, Request Profiler is available even without web.config modifications. So you can use it when you need it.

 

Hope it is helpfull!


1 reply

Userlevel 3
Badge

Deleted, found answer in your other post.

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved