@@ -593,10 +593,10 @@ module internal Sync =
593
593
|> Log.prop " eventTypes" ( Seq.truncate 5 ( seq { for x in appended -> x.c }))
594
594
let appendedBytes , unfoldsBytes = Event.arrayBytes appended, Unfold.arrayBytes unfolds
595
595
if calfBytes <> 0 then
596
- log.Information( " EqxDynamo {action:l}{act:l} {outcome:l} {stream:l} {exp:l} { ms:f1}ms {ru}RU {appendedE}e {appendedB}b Tip {baseE}->{tipE}e {baseB}->{tipB}b Unfolds {unfolds} {unfoldsBytes}b Calf {calfEvents} {calfBytes}b" ,
597
- " Sync" , " Calve" , outcome, stream, exp , t.ElapsedMilliseconds, ru, appended.Length, appendedBytes, baseEvents, tipEvents, baseBytes, tipBytes, unfolds.Length, unfoldsBytes, calfCount, calfBytes)
598
- else log.Information( " EqxDynamo {action:l}{act:l} {outcome:l} {stream:l} {exp:l} { ms:f1}ms {ru}RU {appendedE}e {appendedB}b Events {events} {tipB}b Unfolds {unfolds} {unfoldsB}b" ,
599
- " Sync" , " Append" , outcome, stream, exp , t.ElapsedMilliseconds, ru, appended.Length, appendedBytes, tipEvents, tipBytes, unfolds.Length, unfoldsBytes)
596
+ log.Information( " EqxDynamo {action:l}{act:l} {outcome:l} {stream:l} {ms:f1}ms {ru}RU {exp:l} {appendedE}e {appendedB}b Tip {baseE}->{tipE}e {baseB}->{tipB}b Unfolds {unfolds} {unfoldsBytes}b Calf {calfEvents} {calfBytes}b" ,
597
+ " Sync" , " Calve" , outcome, stream, t.ElapsedMilliseconds, ru, exp , appended.Length, appendedBytes, baseEvents, tipEvents, baseBytes, tipBytes, unfolds.Length, unfoldsBytes, calfCount, calfBytes)
598
+ else log.Information( " EqxDynamo {action:l}{act:l} {outcome:l} {stream:l} {ms:f1}ms {ru}RU {exp:l} {appendedE}e {appendedB}b Events {events} {tipB}b Unfolds {unfolds} {unfoldsB}b" ,
599
+ " Sync" , " Append" , outcome, stream, t.ElapsedMilliseconds, ru, exp , appended.Length, appendedBytes, tipEvents, tipBytes, unfolds.Length, unfoldsBytes)
600
600
return result }
601
601
602
602
[<RequireQualifiedAccess; NoEquality; NoComparison>]
@@ -659,9 +659,8 @@ module internal Tip =
659
659
let eventsCount , unfoldsCount , bb , ub = tip.e.Length, tip.u.Length, Batch.bytesBase tip, Batch.bytesUnfolds tip
660
660
let log = logMetric ( bb + ub) ( eventsCount + unfoldsCount) Log.Metric.Tip
661
661
let log = match maybePos with Some p -> log |> Log.prop " startPos" p |> Log.prop " startEtag" p | None -> log
662
- let log = log |> Log.prop " etag" tip.etag //|> Log.prop "n" tip.n
663
- log.Information( " EqxDynamo {action:l} {res} {stream:l} v{n} {ms:f1}ms {ru}RU {events}e {unfolds}u {baseBytes}+{unfoldsBytes}b" ,
664
- " Tip" , 200 , stream, tip.n, t.ElapsedMilliseconds, ru, eventsCount, unfoldsCount, bb, ub)
662
+ log.Information( " EqxDynamo {action:l} {res} {stream:l} v{n} {ms:f1}ms {ru}RU {etag} {events}e {unfolds}u {baseBytes}+{unfoldsBytes}b" ,
663
+ " Tip" , 200 , stream, tip.n, t.ElapsedMilliseconds, ru, tip.etag, eventsCount, unfoldsCount, bb, ub)
665
664
return ru, res }
666
665
let private enumEventsAndUnfolds ( minIndex , maxIndex ) ( x : Batch ) : ITimelineEvent < InternalBody > array =
667
666
Seq.append< ITimelineEvent<_>> ( Batch.enumEvents ( minIndex, maxIndex) x |> Seq.cast) ( x.u |> Seq.cast)
@@ -760,12 +759,13 @@ module internal Query =
760
759
|> AsyncSeq.takeWhileInclusive ( function
761
760
| struct ( x, ValueSome e) when isOrigin e ->
762
761
found <- true
762
+ let logLevel = if x.i = 0 then Events.LogEventLevel.Debug else Events.LogEventLevel.Information
763
763
match lastResponse with
764
- | None -> log.Information ( " EqxDynamo Stop stream={stream} at={ index} {case}" , stream , x.i, x.c)
764
+ | None -> log.ForContext ( " stream " , stream ) .Write ( logLevel , " EqxDynamo Stop @{ index} {case}" , x.i, x.c)
765
765
| Some batch ->
766
766
let used , residual = batch |> calculateUsedVersusDroppedPayload x.i
767
- log.Information ( " EqxDynamo Stop stream={stream} at={index} {case} used={used} residual={residual} " ,
768
- stream , x.i, x.c, used, residual)
767
+ log.ForContext ( " stream" , stream )
768
+ .Write ( logLevel , " EqxDynamo Stop @{index} {case} used {used}b residual {residual}b " , x.i, x.c, used, residual)
769
769
false
770
770
| _ -> true )
771
771
|> AsyncSeq.toArrayAsync
0 commit comments