Hechizo SAP Intercompany produces two complementary log file series on every run. The first captures human-readable operation results and caught exceptions in real time; the second records the exact JSON payloads sent to the SAP Business One Service Layer for every document posted. Together they give operators a full audit trail — from high-level success or failure down to the precise HTTP body that was dispatched — without requiring any database query or debugger.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/FCS-Consultores/hechizo-SAP-intercompany/llms.txt
Use this file to discover all available pages before exploring further.
Log File Types
Operation Log
Log/Log_YYYYMMDD.txt — human-readable timestamps, success confirmations, and exception messagesJSON Payload Log
Log/LogJson_YYYYMMDD.txt — full JSON body sent to Service Layer for each documentOperation Logs (Log_YYYYMMDD.txt)
The operation log is the primary diagnostic surface for monitoring a sync run. Every significant action — whether a business partner was created, a document was posted, or an exception was caught — is appended to it in chronological order.
Written by: RegistroLog.Graba(string strLog)
Location: Log\ subdirectory next to MCH_IC.exe (resolved via AppDomain.CurrentDomain.BaseDirectory)
Rotation: One file per calendar day, named Log_YYYYMMDD.txt. A new file is created automatically on the first write after midnight; previous days’ files are never truncated.
Contents: Success confirmations with timestamps, error descriptions from caught exceptions, ODBC driver error messages, and @SINCROERROR table operation results.
Real Entries from Log_20260113.txt
DateTime.Now.ToString("HH:mm:ss tt")), so it appears inline with the message rather than as a separate prefix column.
If the
Log\ directory cannot be created or written to — for example due to a permissions error on the deployment path — the RegistroLog.Graba() method falls back to appending to C:\Temp\log_fatal.txt. Check that path if no Log_YYYYMMDD.txt file appears after a run.JSON Payload Logs (LogJson_YYYYMMDD.txt)
Whenever a document is about to be posted to the Service Layer, Hechizo serializes the full request body and writes it to the JSON payload log before (or alongside) the HTTP call. This makes it possible to inspect the exact data that was sent, independent of what the Service Layer accepted or rejected.
Written by: RegistroLog.GrabaJson(string strLog)
Location: Log\ subdirectory next to MCH_IC.exe — the same directory as the operation log
Rotation: One file per calendar day, named LogJson_YYYYMMDD.txt
Contents: Each entry is prefixed with a context header showing the origin database, source document entry and number, destination database and destination entry, followed by the full JSON object.
Real Entry from LogJson_20260527.txt
[HH:mm:ss AM/PM] BDOrigen: <source_db> DEntryOrg <DocEntry>, DNumOrg <DocNum> / BDDestino <dest_db>, DEntryDest <dest_entry> / Json: {…}. This cross-references a specific payload with the corresponding operation log entry.
The RegistroLog Class
Both log files are produced by the RegistroLog class in MCH_IC/Tools/RegistroLog.cs. A single static instance is created at the top of the Intercompany data class and reused throughout the process:
GrabaProc method and the separate RegistroProcesos class (also in namespace Inter_Hechiz.tools) both write to LogProcesos\LogProc.txt — a single non-rotating file. Both use Directory.GetCurrentDirectory() rather than AppDomain.CurrentDomain.BaseDirectory, so the resolved path follows the process working directory rather than the executable location. This is a legacy mechanism from earlier builds and is no longer the primary log surface. Prefer Log_YYYYMMDD.txt and LogJson_YYYYMMDD.txt for day-to-day operations.
Log Directory Layout
After several runs theLog\ folder alongside MCH_IC.exe will look like this:
Log vs. LogJson — When to use each
Log vs. LogJson — When to use each
| Goal | File to check |
|---|---|
| Did a specific business partner or document sync successfully? | Log_YYYYMMDD.txt |
| What ODBC or Service Layer error was returned? | Log_YYYYMMDD.txt |
| What exact JSON did Hechizo send to the Service Layer? | LogJson_YYYYMMDD.txt |
| Is a field mapped incorrectly (wrong value in the payload)? | LogJson_YYYYMMDD.txt |
| Replay a failed HTTP POST manually in Postman | LogJson_YYYYMMDD.txt |
| Fatal crash where even the Log folder write failed | C:\Temp\log_fatal.txt |