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.
Without checking the code, I cannot be sure, but it seems that you are trying to call
AppName:info/X
without the moduleAppName
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.