processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.08k stars 1.51k forks source link

Elixir Logger clashing with ejabberd #966

Closed johnhamelink closed 8 years ago

johnhamelink commented 8 years ago

Hi there, I'm using ejabberd from the hex repository with my Elixir Umbrella app. I'm coming across the following error when I startup my app using iex -S mix at either the root directory or within the app which has ejabberd as a dependency;

Supervisor 'Elixir.Logger.Supervisor' had child undefined started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}, link) at <0.745.0> exit with reason normal in context child_terminated
pukkamustard commented 8 years ago

I gett the same error. Also in a new and empty Elixir app after following this guide: https://docs.ejabberd.im/developer/elixir/.

mremond commented 8 years ago

I does not get this error. Tried on Linux and OSX.

Do you have custom ejabberd module ? Which Elixir version is it ? Despite :logger and :ejabberd, do you start any other apps ?

mremond commented 8 years ago

@johnhamelink ok, I think I could reproduce it. I will commit experimental back to bridge from lager to Elixir Logger, but it is experimental and may break stuff.

I guess however, it is better to go ahead to gather feedback.

johnhamelink commented 8 years ago

Hi @mremond, thanks for getting back to me :smile: I have a custom module, I'm using 1.2.3, and I have a tonne of other apps. If you commit that experimental change I'll happily test it for you.

Best, JH

mremond commented 8 years ago

I made a commit. error disappear, but log are not properly bridge yet. It seems it will need a bit more work, but at least you can give early feedback.

johnhamelink commented 8 years ago

@mremond yep! I get a nice "20:06:52.428 [info] Ignoring logger options, using Elixir Logger."

mremond commented 8 years ago

ok, good, then. Now, I would like to push ejabberd_logs to Elixir Logger when it is detected. For some reason, this does not fully get through yet, but I will get to it :)

johnhamelink commented 8 years ago

Brilliant, thank you @mremond! :smile:

mremond commented 8 years ago

I think it should now work fine, including integrate with loglevel changing from ejabberd config or admin commands. Please, give a try and tell me how it goes :grinning:

johnhamelink commented 8 years ago

Hi @mremond, I thought I'd already replied to this! We've been using it in production for a month or so now, all good 👍

mremond commented 8 years ago

@johnhamelink Thanks for the update ! Very happy it has been working well for you 😄

almeynman commented 8 years ago

I still receive error with new project (just following tutorial):

17:03:54.541 [info]  Ignoring ejabberd logger options, using Elixir Logger.

17:03:54.605 [info]  Application lager exited: exited in: :lager_app.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in :lager_app.start_error_logger_handler/3
            (lager) src/lager_app.erl:141: :lager_app.start_error_logger_handler(false, 50, [Logger.ErrorHandler])
            (lager) src/lager_app.erl:217: :lager_app.start/2
            (kernel) application_master.erl:273: :application_master.start_it_old/4

Tried with ejabberd 16.4 and 16.3. Elixir version: 1.2.5

Here is the source code.

I think it is just me being stupid, but because I have never worked with ejabberd yet I cannot figure it out

mremond commented 8 years ago

@almasakchabayev This is a bug in lager 3.2 fixed in this commit: https://github.com/basho/lager/commit/4c87abcd4f9d70a1136fff8f573dc7adcc833e43

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.