Fl4m3Ph03n1x
Background
In one of our projects a client of ours complained that the logs he is getting are being capped at 2000 characters.
This client is gettign his logs via a tool called Splunk and perhaps some other systems I am not aware of.
Instead of capping the messages at 2K characters, I need to cap them at 8K.
Config
To me this is strange, because we specifically truncate the log to :infinity, as our config shows:
use Mix.Config
config :logger,
level: :info,
backends: [:console],
utc_log: true,
sync_threshold: 100,
truncate: :infinity
if Mix.env() != :prod do
config :logger,
level: :debug
end
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [
:module,
:line,
:function,
:trace,
:perf,
:duration,
:namespace
]
Furthermore, I didn’t find any specific Logger limits documented:
Question
- Does the Logger have some internal limit that cuts messages down to 2000 characters? If so, how can I change it?
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
At least on the console backend I’m not seeing such a limit. You can test it easily with:
kip
Just for giggles I put it in a test case:
And ran the test:
Fl4m3Ph03n1x
Thanks for the super quick answer!
I have made the test you have mentioned in the first post and concluded that it is very unlikely for the issue to be in the Elixir code we have.
Once again thank you!
NobbZ
Is it perhaps the
:truncateoption? By default it’s 8kiB.al2o3cr
FWIW there is a limiter (see @NobbZ’s post) but there can also be intermediate steps that trim things shorter - at work, lines long enough to hit Logger’s limit (and get
(truncated)at the end) are still split into multiple lines someplace between Logger → syslog → CloudWatch. Not sure what specifically is causing that…KristerV
just so my headache is logged somewhere.
there’s two different layers you can config in the logger. one for backends, one for logger itself. so in my case this helper a lot:
thanks goes to @JonRowe and @LostKobrakai in Slack.
mxgrn
Apparently, the first line is enough. So happy to have found it
c4710n
Updates that fit the current situation:
disable log truncation
As of Elixir 1.14:
config :logger, truncate: :infinityis enough for disabling log truncation.log data
Another point to note if you are planing to print data with
inspect/2:Make sure that inspect will print all the information you want. The following line is a good start:
performance consideration
If the data is large, carefully consider before using the above two steps.
rlopzc
To enable infinite truncation in the new Logger (since Elixir 1.15) do:
ydg33
For future reference: I added
config :logger, :default_formatter, truncate: :infinitytoconfig/config.exsin Phoenix and this additionallyconfig/dev.exs… so I ended up having to remove it. I wish there were more documentation on this.