如何在log4j.properties中定义动态命名的日志文件,急求在线等
#log4j.appender.stdfile.File=../logs/${这里希望动态的以那个用户的用户名命名}.log
我想做一个日志系统,就是注册用户在我网页上所作的一切操作能够输出到一个以他用户名动态命名的.log文件中,想问问各位大牛如何能办到?
还有就是WARN 20130319 20:54:014,278 [org.hibernate.mapping.RootClass:checkCompositeIdentifier] - composite-id class does not override hashCode(): com.data.entity.PlayVideoTime
WARN 20130319 20:54:014,285 [org.hibernate.mapping.RootClass:checkCompositeIdentifier] - composite-id class does not override equals(): com.data.entity.PlayMusicTime
WARN 20130319 20:54:014,286 [org.hibernate.mapping.RootClass:checkCompositeIdentifier] - composite-id class does not override hashCode(): com.data.entity.PlayMusicTime
WARN 20130319 20:54:026,445 [com.control.web.LoginAction:execute] - 用户ye123登录成功!
我只想要最后一句,我该如何剔除上面那些冗余的,莫名其妙就多出来了···
求大神
------解决方案--------------------org.hibernate日志级别设成error
------解决方案--------------------String dynamicLog = // log directory somehow chosen...
Properties p = new Properties( Config.ETC + "/log4j.properties" );
p.put( "log.dir", dynamicLog ); // overwrite "log.dir"
PropertyConfigurator.configure( p );