yassine

yassine

Logging with elixir and elasticsearch

i am working on a phoenix application, and i want to get logs stored in elasticsearch.

it is possible to do that with maybe some elixir libraries or some functions ?

if that true, can some one givs me some ideas please !

Marked As Solved

hauleth

hauleth

Oh, I have read it as you want to send logs to the ES, as otherwise it has nothing to do with the logging. What you are looking for is how to query ElasticSearch, and for that you have some Hex packages. Now you need to pick any of them that will work for you and just query the DB fetching data you need.

However it still has nothing to do with logging, as the source of the data and kind of data you are trying to fetch is irrelevant there.

Also Liked

yassine

yassine

oh yeah, i knew it i didn’t correctly express for what i want i am sorry about that, so i will try using the Hex packages.
thanks a lot.

hauleth

hauleth

Yes, it is. There are 2 approaches possible:

  • Easy: Use syslog/journal/file logging and then dispatch logs to the ES (or any other service) from there
  • Medium: Implement Elixir Logger Backend (or find existing one)
  • Hard: Implement Erlang Logger Handler (I doubt that you will find one that is already done)

Where Next?

Popular in Questions Top

jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement