NLog.Extensions.AzureTableStorage icon indicating copy to clipboard operation
NLog.Extensions.AzureTableStorage copied to clipboard

Better table partition keys?

Open boudinov opened this issue 8 years ago • 1 comments

When using Nlog, one usually has a different logger for each class he uses it in. By choosing logger name as Partition key, aren't you fragmenting you data in awkward way.

When you query log entries, you always first filter by date/time. So for example you query the logs for the last hour or day, and Azure Table is gathering data from god knows how many physical partitions, because the logger names are scattered.

Should't date be main part of partition/row keys?

boudinov avatar Jun 15 '17 18:06 boudinov

Hi there, quoting from readme:

"it is possible to prefix the partition keys used with a custom string. [[PartitionKeyPrefix]] and [[PartitionKeyPrefixKey]] are optional and [[PartitionKeyPrefixKey]] has precedence over a hard coded value in [[PartitionKeyPrefix]]. Further, you can use [[PartitionKeyPrefixDateFormat]] to provide a standard DateTime format string to prefix the partition with, which may result in a better partitioning strategy in some use cases."

I hope that helps.

harouny avatar Jun 19 '17 21:06 harouny