[Gpr_To_Absl_Logging] Fix docs

pull/37011/head
tanvi-jagtap 9 months ago
parent 4d64c4cac7
commit 3575b8c8c5
  1. 24
      TROUBLESHOOTING.md
  2. 5
      doc/environment_variables.md

@ -16,26 +16,32 @@ Verbosity can be set using absl flags such as
These can also be programmatically set using
[these absl APIs.](https://github.com/abseil/abseil-cpp/blob/master/absl/log/globals.h)
Example
```
# Disable all logs other than FATAL for the entire application
./helloworld_application_using_grpc --v=-1 --minloglevel=3
```
## GRPC_VERBOSITY (DEPRECATED)
[Environment Variables Overview](doc/environment_variables.md)
## GRPC_TRACE
`GRPC_TRACE` can be used to enable extra logging for some internal gRPC components. Enabling the right traces can be invaluable
`GRPC_TRACE` can be used to enable extra logging for specific internal gRPC components. Enabling the right traces can be invaluable
for diagnosing for what is going wrong when things aren't working as intended. Possible values for `GRPC_TRACE` are [listed here](doc/trace_flags.md).
Multiple traces can be enabled at once (use comma as separator).
```
# Enable debug logs for an application
# Enable debug logs for the entire application
./helloworld_application_using_grpc --v=2 --minloglevel=0
```
```
# Print information about invocations of low-level C core API.
# Note that trace logs of log level DEBUG won't be displayed.
# Also note that many tracers user log level INFO,
# so without setting absl verbosity accordingly, no traces will be printed.
# Note that trace logs that use `VLOG` won't be displayed.
# Many tracers user log level INFO.
# So unless absl settings are correct, no traces will be printed.
GRPC_TRACE=api ./helloworld_application_using_grpc --v=-1 --minloglevel=0
```
@ -49,3 +55,11 @@ Known limitations: `GPRC_TRACE=tcp` is currently not implemented for Windows (yo
Please note that the `GRPC_TRACE` environment variable has nothing to do with gRPC's "tracing" feature (= tracing RPCs in
microservice environment to gain insight about how requests are processed by deployment), it is merely used to enable printing
of extra logs.
## Preventing gRPC Log Noise
Log noise could consume a lot of resources. We recommend tuning settings for production systems very carefully.
* Avoid using GRPC_VERBOSITY flag. This has been deprecated. If this value of this flag is anything other than "ERROR" or "NONE" it will cause log noise.
* Always avoid setting --v and --vmodule to anything other than -1 for production systems.
* Avoid setting --minloglevel=0 for production systems. Anyting greater than 0 should be fine.
* If setting this does not eliminate your log noise, look for instances of functions `--v`, `--vmodule`, `absl::SetVLogLevel` and `absl::SetMinLogLevel` in your entire codebase and any libraries/components/configs that you may be using.

@ -62,9 +62,8 @@ some configuration as environment variables that can be set.
- If nothing is set as GRPC_VERBOSITY, then the setting of the exernal application will be honoured.
- If nothing is set by the external application also, the default set by absl will be honoured.
* GRPC_STACKTRACE_MINLOGLEVEL
Minimum loglevel to print the stack-trace - one of DEBUG, INFO, ERROR, and NONE.
NONE is a default value.
* GRPC_STACKTRACE_MINLOGLEVEL (DEPRECATED)
This will not work anymore.
* GRPC_TRACE_FUZZER
if set, the fuzzers will output trace (it is usually suppressed).

Loading…
Cancel
Save