Lager multiple sinks for different sub-applications

116 Views Asked by At

So what i am trying to do is this:

Whenever a module calls ?DEBUG() OR ?INFO() OR ?WARNING() ETC (DEBUG, INFO, WARNING are macros defined as APPNAME:debug/APPNAME:info/APPNAME:warning ETC respectively) and APPNAME is also another macro which is defined as - application:get_application(), so that whenever an app's module or process calls ?DEBUG/?WARNING/?INFO the log will go to there respective app's lager sink. But i get the following error:

{'module could not be loaded',APPNAME HERE}

I don't get why i am getting this error since i have already set up the extra lager sinks in config. Please help.

1

There are 1 best solutions below

0
On

Without checking the code, I cannot be sure, but it seems that you are trying to call AppName:info/X without the module AppName existing, it does not reach lager. Maybe you need to check your code loading strategy?

Applications are an OTP concept and modules are an erlang one, there's no requirement to have a module with the same name as its application.