Search code examples
azureloggingnlogazure-table-storageslash

NLog container name format


Does NLog not work when container name has '/' without any exception? I have the following code in one place of my application:

    _log.AddLog("TestController", "Just test", LogLevel.INFO);

and it works fine (write to my Azure Table Storage). But I have the following code in another place:

                _log.AddLog("PricingController/PaymentCreditCard", p_ex.Message, LogService.LogLevel.WARN);

and it does not work without any error/exception. Just no write anything. I spent approx 1 hour to search why and found, that without '/' it works. I have read NLog documentation and did not find any word about slash in container name. Or it's a problem of wrapper, which write to Azure Table Storage?


Solution

  • as Gaurav Mantri said above, problem is in PartitionKey, where symbol '/' is denied https://msdn.microsoft.com/en-us/library/azure/dd179338.aspx , section "Characters Disallowed in Key Fields"