EMottet
EMottet

Reputation: 310

IEx truncated Error stackstrace despite of config

My config ~/.iex.exs is :

IEx.configure(inspect: [limit: :infinity, printable_limit: :infinity, pretty: true , safe: false] )

In IEx, strings, lists are not truncated, but despite the configuration ,I have some errors troncated like :

19:35:15.338 [error] #PID<0.404.0> running HTTP (cowboy_protocol) terminated
Server: localhost:4201 (http)
Request: GET /api?elemen_id%5B%5D=FOO_1&elemen_id%5B%5D=FOO_2&*********************************** (truncated)

If someone have a good idea !

Thanks !

Upvotes: 0

Views: 1275

Answers (1)

Aleksei Matiushkin
Aleksei Matiushkin

Reputation: 121000

inspect: option of IEx.configure/1 does indeed configure IEx

A keyword list containing inspect options used by the shell when printing results of expression evaluation. Default to pretty formatting with a limit of 50 entries.

It does affect the default options of Inspect protocol implementation. Errors come as binaries from what formatted this error already truncated. The message comes from cowboy which apparently uses error_logger by default. So, the message might be initially truncated by error_logger or, as specified in comments by @m3characters by Logger application.

The easiest approach I’d suggest is to config cowboy to use Logger application and then to config Logger to not truncate messages by default (use :infinity as limit.) Maybe the latter step only would suffice.

Upvotes: 1

Related Questions