日志初始化,可以合并成一句的
protected Logger m_logger =Logging.getLogger(this.getClass().getName());最好放在类一级的地方,比如public class MyClasss {
protected Logger m_logger =Logging.getLogger(this.getClass().getName());
...
protected Logger m_logger =Logging.getLogger(this.getClass().getName());最好放在类一级的地方,比如public class MyClasss {
protected Logger m_logger =Logging.getLogger(this.getClass().getName());
...
解决方案 »
- j2ee中公文流转的问题
- spring中hibernatedaosupport以及ApplicationContext问题
- 求EXT2.0写的日历控件
- XML解析不完.帮帮我
- 请教ibatis配置问题
- 急~关于struts2中的<s:iterator>标签问题
- 关于Spring整合Struts和Hibernate的一个奇怪现象
- Hibernate+mysql 查询中文时出错
- 急-----java word操作!
- 给分 struts2 MVC三层增删查改例题 请发到邮箱 [email protected]
- 救我啊,JBuilder2007中文版和weblogic server9.1要怎么配置?
- SAX解析器的skippedEntity(String name)方法什么时候调用的?
就是
public class MyClasss {
protected String ...;
protected int ...;public MyClasss (){
protected Logger m_logger =Logging.getLogger(this.getClass().getName());
...
}
2 方法里面不允许有protected 等描述符
3 如果改成这样,倒是可以的
public class MyClasss {
protected Logger m_logger = null;
public MyClasss (){
m_logger =Logging.getLogger(this.getClass().getName());
}
}4 log4j 是一个日志工具,你可以到google/baidu 去搜一下,太多了。
可以好好看看