3

How to get dump of all messages (raw payload) that are traveling between client <> server ? I tried to configure logging verbosity for following namespaces, without any success..

Microsoft.AspNetCore.SignalR.*
Microsoft.AspNetCore.Http.Connections.*
Microsoft.AspNetCore.Http.Connections.Internal.Transports.WebSocketsTransport.*

A lots of information, but all I got is :

DefaultHubDispatcher - Received hub invocation: InvocationMessage { InvocationId: "0", Target: "sendMessage", Arguments: [ System.Collections.Generic.List`1[  MyMessageHubType  ] ], StreamIds: [  ] }. 

I tried to override ToString() on MyMessageHubType, nu success ..

Any clues ? Somebody managed to accomplish this ?

Mitja Gustin
  • 1,723
  • 13
  • 17
  • It seems to be by design. A workaround is that you could pass a logger instance to the Hub and add the message got in the hub into the applicationLog , refer to [this thread](https://stackoverflow.com/questions/56689026/how-to-pass-logger-into-signalr-hub-on-server-side-in-asp-net-core-application). – Xueli Chen Apr 08 '20 at 09:38
  • 1
    The refering thread uses string as a signature. I'm using strongly typed message (POCO) object in hub's SendMessage and I would like to see original messages before deserialization failed. – Mitja Gustin Apr 09 '20 at 09:21
  • Did you found anything on this topic ? I've been searching a lot but i didnt found any solution to this. – mbpakalin Oct 14 '20 at 17:52
  • No i did not. Added a custom logger to dump messages. But aspnetcore logs are still useful in case incoming traffic has invalid json messages, because parse and serialization errors describe what went wrong. – Mitja Gustin Oct 15 '20 at 06:31

0 Answers0