View Source GRPC.Server.Interceptors.Logger (grpc v0.6.0)

Print log around server rpc calls, like:

17:18:45.151 [info]  Handled by HelloServer.say_hello
17:18:45.151 [info]  Response :ok in 11µs

options

Options

  • :level - the desired log level. Defaults to :info
  • :accepted_comparators - a list with the accepted Logger.compare_levels(configured_level, Logger.level()) results. Defaults to [:lt, :eq]

usage

Usage

defmodule Your.Endpoint do
  use GRPC.Endpoint

  intercept GRPC.Server.Interceptors.Logger, level: :info
end

defmodule Your.Endpoint do
  use GRPC.Endpoint

  # logs on :info and higher priority (warn, error...)
  intercept GRPC.Server.Interceptors.Logger, level: :info, accepted_comparators: [:lt, :eq]
end

defmodule Your.Endpoint do
  use GRPC.Endpoint

  # logs only on :error
  intercept GRPC.Server.Interceptors.Logger, level: :error, accepted_comparators: [:eq]
end

Link to this section Summary

Link to this section Functions