[ejabberd] Logging from a plugin

Raoul Duke rduke496 at gmail.com
Thu Jan 4 20:16:22 MSK 2018


I have a custom ejabberd module in which I would like to log some user
events for later analysis.

I don't really want that info to be logged in the normal ejabberd.log as it
is only gong to be annoyingly verbose in that file.

So what I want to do is log the events to either a different log file or
some syslog type thing where I can rotate the logs when they get a certain
size etc.

I've looked at lager but it seems like potentially a complex ask to try to
make something like that coexist with the normal ejabberd logging config.

Is syslog the way to go here?  Or is there another approach you would
recommend?  Is there something simple i can do to leverage lager here which
I'm missing?  If so can you provide a pointer to some example I could use
to give me a headstart.

I want something that doesn't require a lot of extra libraries added to
ejabberd which would complicate my ejabberd setup so it would be attractive
to use lager or something small that could be bolted on.  I actually
consideered logging to a redis queue since ejabberd has a built-in redis
client but that seems a bit hoky.

All suggestions welcome.

Thanks,
RD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20180104/fa4e3182/attachment.html>


More information about the ejabberd mailing list