Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 8db7741

Browse files
might as well print it in the logs
1 parent 9d010c4 commit 8db7741

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/SqlStreamStore.HAL/Index/IndexResource.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace SqlStreamStore.HAL.Index
33
using System;
44
using System.Reflection;
55
using Halcyon.HAL;
6+
using Newtonsoft.Json;
67
using Newtonsoft.Json.Linq;
78

89
internal class IndexResource : IResource
@@ -29,8 +30,8 @@ public IndexResource(IStreamStore streamStore)
2930
private static string GetVersion(Type type)
3031
=> type.Assembly
3132
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
32-
?.InformationalVersion ??
33-
type.Assembly
33+
?.InformationalVersion
34+
?? type.Assembly
3435
.GetCustomAttribute<AssemblyVersionAttribute>()
3536
?.Version
3637
?? "unknown";
@@ -42,5 +43,7 @@ private static string GetVersion(Type type)
4243
.Index().Self()
4344
.Find()
4445
.Add(Constants.Relations.Feed, Constants.Streams.All)));
46+
47+
public override string ToString() => _data.ToString(Formatting.None);
4548
}
4649
}

src/SqlStreamStore.HAL/SqlStreamStoreHalMiddleware.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using SqlStreamStore.HAL.AllStreamMessage;
1313
using SqlStreamStore.HAL.Docs;
1414
using SqlStreamStore.HAL.Index;
15+
using SqlStreamStore.HAL.Logging;
1516
using SqlStreamStore.HAL.StreamMessage;
1617
using SqlStreamStore.HAL.StreamMetadata;
1718
using SqlStreamStore.HAL.Streams;
@@ -23,6 +24,8 @@
2324

2425
public static class SqlStreamStoreHalMiddleware
2526
{
27+
private static ILog s_Log = LogProvider.GetLogger(typeof(SqlStreamStoreHalMiddleware));
28+
2629
private static MidFunc CaseSensitiveQueryStrings => (context, next) =>
2730
{
2831
if(context.Request.QueryString != QueryString.Empty)
@@ -81,6 +84,8 @@ public static IApplicationBuilder UseSqlStreamStoreHal(
8184
var streamMetadata = new StreamMetadataResource(streamStore);
8285
var streamMessages = new StreamMessageResource(streamStore);
8386

87+
s_Log.Info(index.ToString);
88+
8489
return builder
8590
.UseExceptionHandling()
8691
.Use(CaseSensitiveQueryStrings)

0 commit comments

Comments
 (0)