The curious case of missing Sitecore Commerce Engine Log Files

While recently developing a custom Commerce Engine plugin in Sitecore Commerce 8.2.1, I noticed that the engine was not producing any log files. The usual location (CommerceEngine\wwwroot\logs) had no signs of the runtime logs (files of the format SCF.*.txt), and only had Node Configuration logs.

1_YZT4SJvSKnnBPlnZVU9WQQ

After banging my head against the computer screen, frantically recycling the commerce engine application pool, and inflicting myself with scathing self-doubt- I realized that the problem was much deeper than I had thought. Even Google almighty was unable to give me an answer.

So I began my journey into the rabbit hole we call configs. Fortunately for me, it didn’t take too long to figure out what the problem was. I hit gold on the first strike- CommerceEngine\wwwroot\config.json.

1_pjYLHGdRAw95gvuJEHYYYw

On the surface, it looked fine- but it just seemed too succinct and empty. I decided to head over to the Sitecore Commerce SDK and compared it with the default config.json. Lo and behold, there was one crucial section missing- logging configuration!

If you want your Commerce Engine to log shit- be sure to have this in your config.json:

  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Information",
      "System": "Warning",
      "Microsoft": "Warning"
    },
    "ApplicationInsightsLoggingEnabled": false,
    "SerilogLoggingEnabled": true
  },
  "Serilog": {
    "MinimumLevel": "Information"
  },