Logger with topic-based backend?

One the cool things about the Logger is that it can be compiled completely out of your application in places based on the logging level of your release.

I’d like to take advantage of this for debugging, but Logging against a topic that I could pubsub against. That way, I could leave code in my application that could get compiled out in the production release – but, in development, I could subscribe to a single topic to monitor facets of the application that I’m coding against.

Are there any Logger backends with functionality similar to this? Or simple ways to pull it off? Or would I need to write this myself maybe?


If you are on Elixir 1.10+ then you can use Erlang’s logger :domain field in metadata and filter on that. However that will not help if the primary filter will be higher than the level of the messages (but in that case you can reverse the filter and raise logger verbosity).