简体   繁体   中英

Configure PartitionKey using Semantic Logging Windows Azure

I am trying to configure Semantinc Logging out of the process to write to Azure.

I finally managed to write events into a Table storage. My problem is how do I define PartitionKey.

I just inserted a couple of tests and the PartitionKeys are:

2520107100599999999
2520107103599999999

I would like to have the partitions defined by me (for instance, partition by day).

How do I do that?

This is my actual configuration

<windowsAzureTableSink name="Windows Azure Storage" instanceName="xxxxxxx" connectionString="xxxxxxx">
    <sources>
        <eventSource name="myCompany" level="Error"/>
    </sources>
</windowsAzureTableSink>

Not really an answer to your question but I'm guessing that you would want to specify partition by day because you would want to query this data on a date basis. Assuming this is correct, you can still achieve this with the current partitioning scheme. Essentially the PartitionKey you see represents date/time value. This is how it is derived:

DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks

The PartitionKey value has minute level granularity. So if you apply the logic above, 2520107100599999999 essentially translates to 2014-02-05T08:59:00Z .

Again, I may be wrong in my assumption and if that's the case, please let me know and I'll delete the answer. Thought I would post it as it is not really obvious that a date/time value can be derived from PartitionKey value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM