开发者

log4j.properties Simple question

开发者 https://www.devze.com 2023-02-16 08:43 出处:网络
log4j.logger.mylog= debug, A1 I want开发者_高级运维 to know 2 things, what is \"mylog\" here? what is \"A\" here?

log4j.logger.mylog = debug, A1

I want开发者_高级运维 to know 2 things,

  1. what is "mylog" here?
  2. what is "A" here?


mylog is the logger name (which you pass to Logger.getLogger() in your code; you can also pass a class in which case the logger name is the name of the class). In fact in a configuration file it can be the prefix for a logger name - so in this case, any logger name beginning with mylog will use appender A1 (and possibly others).

A1 is the appender name (which is configured elsewhere in the configuration file) - this determines where the actual output goes.

The "short introduction to log4j" is a good starting point for this sort of thing.


  • mylog is the name of your logger (as requested in your code using Logger.getLogger("mylog").
  • A1 is the id of an appender that you defined in your configuration.
0

精彩评论

暂无评论...
验证码 换一张
取 消