Which stream does gRPC log to?

31 views
Skip to first unread message

Paulin Todev

unread,
Sep 29, 2020, 1:35:35 PM9/29/20
to grpc.io
Hi,

I've been trying to save the gRPC output to a log file when using GRPC_TRACE and GRPC_VERBOSITY, but I'm not sure how to pick it up. I use C++ on Windows:
  • When I run my application from cmd, I see the gRPC output
  • When I start it from the Visual Studio debugger I don't see it in the console output. I also don't see it in the Output tab in Visual Studio.
So I was just wondering if someone could clarify to which output stream the gRPC log goes please? It doesn't seem to be normal cout; is it a cerr or a clog?

Regards,
Paulin

yas...@google.com

unread,
Oct 1, 2020, 3:12:54 PM10/1/20
to grpc.io

Paulin Todev

unread,
Oct 1, 2020, 6:23:39 PM10/1/20
to grpc.io
Thank you, that was helpful.

In case anyone reading this in the future has the same problem - I solved mine by using gpr_set_log_function() in the log.h file:
https://grpc.github.io/grpc/cpp/impl_2codegen_2log_8h.html#ae437062e3540eeebb4c95f119fe56be5

Reply all
Reply to author
Forward
0 new messages