Skip to content

Commit f0c1f8b

Browse files
committed
Force nonhierachical property: sample
Use new column option `ResolveHierarchicalPropertyName` in WorkerServiceDemo sample app. Issue #542
1 parent 2d037df commit f0c1f8b

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

sample/WorkerServiceDemo/Worker.cs

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
2727
};
2828
_logger.LogInformation("{@Structured} {@Scalar}", structured, "Scalar Value");
2929

30+
31+
// Logging a property with dots in its name to AdditionalColumn3
32+
// but treat it as unstructured according to configuration in AdditionalColumns in appsettings.json
33+
_logger.LogInformation("Non-structured property with dot-name to AdditionalColumn3 {@NonstructuredProperty.WithNameContainingDots.Name}",
34+
new Random().Next().ToString());
35+
3036
while (!stoppingToken.IsCancellationRequested)
3137
{
3238
_logger.LogInformation("Worker running at: {time}. CustomProperty1: {CustomProperty1}",

sample/WorkerServiceDemo/appsettings.json

+19-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"columnName": "Timestamp",
2828
"convertToUtc": false
2929
},
30-
"additionalColumns": [
30+
"customColumns": [
3131
{
3232
"columnName": "AdditionalColumn1",
3333
"propertyName": "CustomProperty1",
@@ -37,6 +37,12 @@
3737
"columnName": "AdditionalColumn2",
3838
"propertyName": "Structured.Name",
3939
"dataType": "12"
40+
},
41+
{
42+
"columnName": "AdditionalColumn3",
43+
"propertyName": "NonstructuredProperty.WithNameContainingDots.Name",
44+
"resolveHierarchicalPropertyName": false,
45+
"dataType": "12"
4046
}
4147
]
4248
},
@@ -63,11 +69,22 @@
6369
"columnName": "Timestamp",
6470
"convertToUtc": false
6571
},
66-
"additionalColumns": [
72+
"customColumns": [
6773
{
6874
"columnName": "AdditionalColumn1",
6975
"propertyName": "CustomProperty1",
7076
"dataType": "12"
77+
},
78+
{
79+
"columnName": "AdditionalColumn2",
80+
"propertyName": "Structured.Name",
81+
"dataType": "12"
82+
},
83+
{
84+
"columnName": "AdditionalColumn3",
85+
"propertyName": "NonstructuredProperty.WithNameContainingDots.Name",
86+
"resolveHierarchicalPropertyName": false,
87+
"dataType": "12"
7188
}
7289
]
7390
}

0 commit comments

Comments
 (0)