[英]Lager multiple sinks for different sub-applications
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.每当一个模块调用?DEBUG() OR?INFO() OR?WARNING() ETC (DEBUG, INFO, WARNING 是分别定义为 APPNAME:debug/APPNAME:info/APPNAME:warning ETC 的宏) 并且 APPNAME 也是另一个宏被定义为 - application:get_application(),因此每当应用程序的模块或进程调用?DEBUG/?WARNING/?INFO 时,日志将 go 到相应应用程序的较大接收器。 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.我不明白为什么会收到此错误,因为我已经在 config.xml 中设置了额外的啤酒接收器。 Please help.
请帮忙。
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.如果不检查代码,我无法确定,但似乎您正在尝试调用
AppName:info/X
而不存在模块AppName
,它没有达到更大的值。 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.应用程序是一个 OTP 概念,模块是 erlang 一个,不需要具有与其应用程序同名的模块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.