There are ways to redirect stderr process-wide, but that's probably not what you are looking for. We don't have a C++ API for overriding the default log mechanism. We do have a gRPC Core API to set the logging function though - https://github.com/grpc/grpc/blob/2cd1501ca5ec0cf7db9fd63dd07508b54eaf8d4d/include/grpc/support/log.h#L85 Note that this API is not considered stable and is subject to change.
On Saturday, March 25, 2023 at 9:33:16 AM UTC-7 vinay Nayak wrote: > Hi, have recently started working on grpc v1.52.1 using C++ on linux > platform. > Found out that gpr_log function is being used for logging mechanism. > Was looking for redirecting gpr_logs to any given file by user so that can > be analyzed later if any need arises. Is it supported in the above grpc > version for C++ on linux. > > When looked at code, it is printing all grpc logs to std_err. > Also, found out that for php there is an option to mention the log file > using variable "grpc.log_filename" > > Can any one confirm, does "logs redirecting to file" is supported for c++ > language also ? If so, how to enable it ? > > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/2154760f-76d3-4366-993f-5c7dc8c7aa6en%40googlegroups.com.