看看log4j.jar下面有个ie5的config# For the general syntax of property based configuration files see the
# documenation of org.apache.log4j.PropertyConfigurator.# The root category uses the appender called A1. Since no priority is
# specified, the root category assumes the default priority for root
# which is DEBUG in log4j. The root category is the only category that
# has a default priority. All other categories need not be assigned a
# priority in which case they inherit their priority from the
# hierarchy.log4j.rootCategory=, A1# A1 is set to be a LogMonitorAppender which outputs to a swing
# logging console. 
  
log4j.appender.A1=org.apache.log4j.lf5.LF5Appender读读注释就明白什么意思了,也可以到他们网站上去看看啊!我们是这么配的:
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

解决方案 »

  1.   

    我说的不是这样意思?
    我现在的项目组中自己定义了以下这些级别。
    0 – Error  致命エラー、プログラム中断を引き起こす。
    1 – Warring  警告、プログラム中断を引き起こさない。
    2 – Info 重要な情報。
    3 – Info  一般情報。
    4 – In/Out 重要な関数入口と出口情報。
    5 – In/Out 比較的に重要な関数入口と出口情報。
    6 – In/Out 一般関数入口と出口情報。
    我现在是想用这些级别替换log4j原有的fatal error warn info debug这几种。
    那么,我是不是要重写Logger、Level这些类。或者有什么别的方法?
      

  2.   

    可以通过Priority类的子类去定义自己的优先级。其实log4j中的Level类就是继承了Priority类实现的默认的那五个级别。
    你可以模仿Level类写一个自己的类,定义自己的级别就可以了!具体的写法见Level类:)