?????? why can log4j2 not print on console in command window

2013-09-09 Thread ?????Y
when i remove log4j-over-slf4j-1.7.5.jar .the command line print the third 
party log,e.g.
 09, 2013 6:50:39  
org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing 
org.springframework.context.support.ClassPathXmlApplicationContext@535e27: 
startup date [Mon Sep 09 18:50:39 CST 2013]; root of context hierarchy
 09, 2013 6:50:39  
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring-config.xml]


I find in the class named AbstractApplicationContext ,the log class is as 
follows:
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Log  logger = LogFactory.getLog(getClass());



and my log classes is as follows:


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

private static final Logger logger = LoggerFactory.getLogger(OOXX.class);



however ,my project's message still can't be printed.








--  --
??: Remko Popma;remko.po...@gmail.com;
: 2013??9??9??(??) 6:26
??: Log4J Users Listlog4j-user@logging.apache.org; 

: Re: why can log4j2 not print on console in command window



If you have  log4j-slf4j-impl-2.0-beta8.jar then I believe you don't
need log4j-over-slf4j-1.7.5.jar
(isn't this jar for log4j-1.2?) Can you remove it and try again?

On Monday, September 9, 2013, ?Y 41157...@qq.com wrote:

 I have use the version beta 8 for log4j2, I have third-party framework
 using in my project ,e.g. spring which using slf4j.
 and i import the jars into my libaray :log4j-over-slf4j-1.7.5.jar
 log4j-api-2.0-beta8.jar log4j-core-2.0-beta8.jar
  log4j-slf4j-impl-2.0-beta8.jar


 and my java environment is JDK 7,my configration file named log4j2.xml is
 as following :
 ?xml version=1.0 encoding=UTF-8?!-- status=debug 
 log4j??
 --configuration status=off monitorInterval=30 properties
  property name=LOG_HOME/log/fish/property  !-- 
 -- property name=BACKUP_HOME{LOG_HOME}/backup/property
 property name=STAT_NAMEstat/property  property
 name=SERVER_NAMEglobal/property  /properties   appenders
   !-- ?? --Console name=Console
 target=SYSTEM_OUTPatternLayout
 pattern=%date{-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] -
 %msg%n /   /Console  !-- ?? --
  FastRollingFile name=DevLog fileName=${LOG_HOME}/${SERVER_NAME}

  filePattern=${LOG_HOME}/${SERVER_NAME}.%d{-MM-dd-HH}.log
   PatternLayout pattern=%date{-MM-dd HH:mm:ss.SSS} %level
 [%thread][%file:%line] - %msg%n /   Policies
TimeBasedTriggeringPolicy interval=1
 modulate=true /  /Policies
 /FastRollingFile  !--  --
 FastRollingFile name=ProductLog
  fileName=${LOG_HOME}/${SERVER_NAME}_${STAT_NAME}
  filePattern=${LOG_HOME}/${SERVER_NAME}_${STAT_NAME}.%d{-MM-dd-HH}.log
PatternLayout
  pattern=%date{-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] -
 %msg%n /  Policies
  TimeBasedTriggeringPolicy interval=1
 modulate=true /  /Policies
 /FastRollingFile  /appendersloggers   !--
 3rdparty Loggers --   logger name=org.springframework.core
 level=info   /logger   logger
 name=org.springframework.beans level=info  /logger
 logger name=org.springframework.context level=info
  /logger   logger name=org.springframework.web
 level=info/logger   logger
 name=org.jboss.netty level=warn/logger
 logger name=org.apache.http level=warn/logger
 !-- Game Stat logger --   logger
 name=com.u9.global.service.log level=info
 additivity=false appender-ref ref=ProductLog /
 /logger   !-- Root Logger --root
 level=DEBUGappender-ref ref=DevLog /
   appender-ref ref=Console /  /root
 /loggers/configuration

 when I run my project ,it works ok in eclipse,everything print ok in
 console. however,when i compile the project to jar ,and run it by start.bat
 ,log4j2 can.t print output in cmd window,i can't catch the reason,pls help
 me. thank you!

Re: ?????? ??????why can log4j2 not print on console in command window

2013-09-09 Thread ?????Y
the file's content inclued in  global.jar named  manifest.mf is as following??


Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.2
Created-By: 1.7.0_25-b17 (Oracle Corporation)
Main-Class: com.u9.global.GlobalServer
Built-By: Administrator
Built-Date: 2013-09-09 20:03:56
Implementation-Version: ${branch}-${version}
Class-Path: lib/antlr-2.7.6.jar lib/aopalliance-1.0.jar lib/asm-2.2.3.
 jar lib/asm-commons-2.2.3.jar lib/aspectjrt.jar lib/aspectjweaver.jar
  lib/bcel-5.2.jar lib/c3p0-0.9.1.jar lib/cglib-nodep-2.2.jar lib/comm
 ons-cli-1.2.jar lib/commons-codec-1.4.jar lib/commons-collections.jar
  lib/commons-httpclient-3.1.jar lib/commons-io.jar lib/commons-lang-2
 .4.jar lib/commons-logging-1.1.1.jar lib/commons-pool.jar lib/dom4j-1
 .6.1.jar lib/fastjson-1.1.35.jar lib/game-common.jar lib/guava-14.0.1
 .jar lib/jasypt-1.5.jar lib/javassist-3.4.GA.jar lib/jaxen-1.1-beta-7
 .jar lib/jedis-2.1.0.jar lib/log4j-api-2.0-beta8.jar lib/log4j-core-2
 .0-beta8.jar lib/log4j-over-slf4j-1.7.5.jar lib/log4j-slf4j-impl-2.0-
 beta8.jar lib/lua-java-1.1.jar lib/luaj-jse-2.0.2.jar lib/mysql-conne
 ctor-java-5.1.13.jar lib/netty-3.6.6.Final.jar lib/protobuf-java-2.5.
 0.jar lib/protobuf-java-format-1.2.jar lib/slf4j-api-1.7.5.jar lib/sn
 appy-java-1.0.3.2.jar lib/spring-aop-3.2.4.RELEASE.jar lib/spring-asp
 ects-3.2.4.RELEASE.jar lib/spring-beans-3.2.4.RELEASE.jar lib/spring-
 context-3.2.4.RELEASE.jar lib/spring-context-support-3.2.4.RELEASE.ja
 r lib/spring-core-3.2.4.RELEASE.jar lib/spring-expression-3.2.4.RELEA
 SE.jar lib/spring-jdbc-3.2.4.RELEASE.jar lib/spring-tx-3.2.4.RELEASE.
 jar





-- Original --
From:  Jacob Kjome;h...@visi.com;
Date:  Mon, Sep 9, 2013 01:24 AM
To:  Log4J Users Listlog4j-user@logging.apache.org; 

Subject:  Re:  ?? ??why can log4j2 not print on console in command  
window




Please post the contents of the manifest.mf file.  Unless you have a period in 
the Class-Path value, then the current directory won't get placed in the 
classpath using the -jar option.  Hence, your log4j2.xml won't get picked up.

For instance..

Class-Path: . someJarDep.jar


Jake


On Mon, 9 Sep 2013 00:07:36 +0800
 =?gb18030?B?wffX06lZ?= 41157...@qq.com wrote:
 1.my project is named global,and it is compiled to global.jar using ant 
script ,the content of file named start.bat is as this:java  -jar global.jar
 2.When I run from the command line from my global.jar ,the log4j2.xml file 
 is located at the same file directory level with global.jar and start.bat
 
 
 thank you for your answer !
 Allen
 
 
 --  --
 ??: Ralph Goers;ralph.go...@dslextreme.com;
 : 2013??9??8??(??) 11:53
 ??: Log4J Users Listlog4j-user@logging.apache.org; 
 
 : Re: ??why can log4j2 not print on console in command window
 
 
 
 1. What does start.bat do? Can you post the source?
 2. When you run from the command line from your jar where is the log4j2.xml 
file located?
 
 Ralph
 
 On Sep 8, 2013, at 8:36 AM, ?Y wrote:
 
 i use log4j2 as following:
 iimport org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 private static final Logger logger = LogManager.getLogger(OOXX.class);
 
 
 
 
 --  --
 ??: ;41157...@qq.com;
 : 2013??9??8??(??) 11:32
 ??: log4j-user-infolog4j-user-i...@logging.apache.org; 
log4j-user-faqlog4j-user-...@logging.apache.org; 
log4j-userlog4j-user@logging.apache.org; 
 
 : why can log4j2 not print on console in command window
 
 
 
 I have use the version beta 8 for log4j2, I have third-party framework using 
in my project ,e.g. spring which using slf4j.
 and i import the jars into my libaray :log4j-over-slf4j-1.7.5.jar 
log4j-api-2.0-beta8.jar log4j-core-2.0-beta8.jar 
 log4j-slf4j-impl-2.0-beta8.jar
 
 
 and my java environment is JDK 7,my configration file named log4j2.xml is as 
following :
 ?xml version=1.0 encoding=UTF-8?!-- status=debug 
log4j?? --configuration status=off 
monitorInterval=30 propertiesproperty 
name=LOG_HOME/log/fish/property  !--  --   
property 
name=BACKUP_HOME{LOG_HOME}/backup/property   property 
name=STAT_NAMEstat/property  property 
name=SERVER_NAMEglobal/property  /properties   appenders 
!-- 
?? --Console name=Console 
target=SYSTEM_OUT  PatternLayout 
pattern=%date{-MM-dd HH:mm:ss.SSS} 
%level [%thread][%file:%line] - %msg%n //Console  
!-- ?? 
--   FastRollingFile name=DevLog 
fileName=${LOG_HOME}/${SERVER_NAME} 
filePattern=${LOG_HOME}/${SERVER_NAME}.%d{-MM-dd-HH}.log   
  PatternLayout 
pattern=%date{-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - 
%msg%n /Policies  
TimeBasedTriggeringPolicy interval=1 

?????? ??????why can log4j2 not print on console in command window

2013-09-09 Thread ?????Y
hi,the attachement is my  test project. can you help me to have a look the 
issue? 
the  source.jar is the source code , and product.rar is the  release version .
you can double click start.bat to run.


source.jar http://url.cn/WX6MH2
product.rar http://url.cn/JURine


when I run my project ,it works ok in eclipse,everything print ok in console. 
however,when i compile the project to jar ,and run it by start.bat ,log4j2 
can.t print output in cmd window,i can't catch the reason,pls help me. thank 
you!
thank you very much.
Regards.
Allen






--  --
??: Ralph Goers;ralph.go...@dslextreme.com;
: 2013??9??8??(??) 11:53
??: Log4J Users Listlog4j-user@logging.apache.org; 

: Re: ??why can log4j2 not print on console in command window



1. What does start.bat do? Can you post the source?
2. When you run from the command line from your jar where is the log4j2.xml 
file located?

Ralph

On Sep 8, 2013, at 8:36 AM, ?Y wrote:

 i use log4j2 as following:
 iimport org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 private static final Logger logger = LogManager.getLogger(OOXX.class);
 
 
 
 
 --  --
 ??: ;41157...@qq.com;
 : 2013??9??8??(??) 11:32
 ??: log4j-user-infolog4j-user-i...@logging.apache.org; 
 log4j-user-faqlog4j-user-...@logging.apache.org; 
 log4j-userlog4j-user@logging.apache.org; 
 
 : why can log4j2 not print on console in command window
 
 
 
 I have use the version beta 8 for log4j2, I have third-party framework using 
 in my project ,e.g. spring which using slf4j.
 and i import the jars into my libaray :log4j-over-slf4j-1.7.5.jar 
 log4j-api-2.0-beta8.jar log4j-core-2.0-beta8.jar  
 log4j-slf4j-impl-2.0-beta8.jar
 
 
 and my java environment is JDK 7,my configration file named log4j2.xml is as 
 following :
 ?xml version=1.0 encoding=UTF-8?!-- status=debug 
 log4j?? --configuration status=off monitorInterval=30  
 propertiesproperty name=LOG_HOME/log/fish/property
   !--  --   property 
 name=BACKUP_HOME{LOG_HOME}/backup/property   property 
 name=STAT_NAMEstat/property  property 
 name=SERVER_NAMEglobal/property  /properties   appenders 
 !-- ?? -- Console name=Console target=SYSTEM_OUT  
   PatternLayout pattern=%date{-MM-dd HH:mm:ss.SSS} 
 %level [%thread][%file:%line] - %msg%n /   /Console   
!-- ?? -- FastRollingFile name=DevLog 
 fileName=${LOG_HOME}/${SERVER_NAME}
 filePattern=${LOG_HOME}/${SERVER_NAME}.%d{-MM-dd-HH}.log   
   PatternLayout pattern=%date{-MM-dd HH:mm:ss.SSS} %level 
 [%thread][%file:%line] - %msg%n /   Policies  
 TimeBasedTriggeringPolicy interval=1 modulate=true 
 /  /Policies /FastRollingFile
   !--  --   FastRollingFile name=ProductLog  
 fileName=${LOG_HOME}/${SERVER_NAME}_${STAT_NAME}
   
 filePattern=${LOG_HOME}/${SERVER_NAME}_${STAT_NAME}.%d{-MM-dd-HH}.log  
   PatternLayout  
 pattern=%date{-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - 
 %msg%n /  Policies  
 TimeBasedTriggeringPolicy interval=1 
 modulate=true /  /Policies 
 /FastRollingFile  /appendersloggers   !-- 3rdparty 
 Loggers --   logger name=org.springframework.core 
 level=info   /logger   logger 
 name=org.springframework.beans level=info  /logger 
   logger name=org.springframework.context level=info
 /logger   logger name=org.springframework.web level=info  
   /logger   logger name=org.jboss.netty 
 level=warn/logger   logger 
 name=org.apache.http level=warn/logger   !-- 
 Game Stat logger --   logger name=com.u9.global.service.log 
 level=info   additivity=false 
 appender-ref ref=ProductLog /   /logger   !-- 
 Root Logger --root level=DEBUG
 appender-ref ref=DevLog /   appender-ref ref=Console 
 /  /root /loggers/configuration
 
 when I run my project ,it works ok in eclipse,everything print ok in console. 
 however,when i compile the project to jar ,and run it by start.bat ,log4j2 
 can.t print output in cmd window,i can't catch the reason,pls help me. thank 
 you!


-
To unsubscribe, e-mail: 

Best practices for web apps with log4j2 + SLF4J + JBoss 7

2013-09-09 Thread Xavier Outhier
Hi all,

I'm currently working on a multiple web apps product. This product used to be 
deployed under Tomcat 7 and has to be deployed under JBoss 7.

Is there any incompatibility issues (a lot of incompatibilities has been found 
so far with our prototype for other part like log4j-contrib for instance)?
Do you have any recommendations, best practices?


Thanks,

Xavier.


回复: 回复:why can log4j2 not print on console in command window

2013-09-09 Thread 流子℡
anybody know why?

---原始邮件---
在 2013年09月09日 20:55:40
4115712141157...@qq.com 写道:
 
hi,the attachement is mytest project. can you help me to have a look the issue? 
thesource.jar is the source code , and product.rar is therelease version .
you can double click start.bat to run.


source.jar http://url.cn/WX6MH2
product.rar http://url.cn/JURine


when I run my project ,it works ok in eclipse,everything print ok in console. 
however,when i compile the project to jar ,and run it by start.bat ,log4j2 
can.t print output in cmd window,i can't catch the reason,pls help me. thank 
you!
thank you very much.
Regards.
Allen






-- 原始邮件 --
发件人: Ralph Goers;ralph.go...@dslextreme.com;
发送时间: 2013年9月8日(星期天) 晚上11:53
收件人: Log4J Users Listlog4j-user@logging.apache.org; 

主题: Re: 回复:why can log4j2 not print on console in command window



1. What does start.bat do? Can you post the source?
2. When you run from the command line from your jar where is the log4j2.xml 
file located?

Ralph

On Sep 8, 2013, at 8:36 AM, 流子℡ wrote:

 i use log4j2 as following:
 iimport org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 private static final Logger logger = LogManager.getLogger(OOXX.class);
 
 
 
 
 -- 原始邮件 --
 发件人: 流子;41157...@qq.com;
 发送时间: 2013年9月8日(星期天) 晚上11:32
 收件人: log4j-user-infolog4j-user-i...@logging.apache.org; 
 log4j-user-faqlog4j-user-...@logging.apache.org; 
 log4j-userlog4j-user@logging.apache.org; 
 
 主题: why can log4j2 not print on console in command window
 
 
 
 I have use the version beta 8 for log4j2, I have third-party framework using 
 in my project ,e.g. spring which using slf4j.
 and i import the jars into my libaray :log4j-over-slf4j-1.7.5.jar 
 log4j-api-2.0-beta8.jar log4j-core-2.0-beta8.jarlog4j-slf4j-impl-2.0-beta8.jar
 
 
 and my java environment is JDK 7,my configration file named log4j2.xml is as 
 following :
 ?xml version=1.0 encoding=UTF-8?!-- status=debug 可以查看log4j的装配过程 
 --configuration status=off monitorInterval=30 propertiesproperty 
 name=LOG_HOME/log/fish/property!-- 日志备份目录 --property 
 name=BACKUP_HOME{LOG_HOME}/backup/propertyproperty 
 name=STAT_NAMEstat/propertyproperty 
 name=SERVER_NAMEglobal/property /properties appenders!-- 定义控制台输出 
 --Console name=Console target=SYSTEM_OUT PatternLayout 
 pattern=%date{-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - 
 %msg%n //Console!-- 程序员调试日志 --FastRollingFile name=DevLog 
 fileName={SERVER_NAME} filePattern={SERVER_NAME}.%d{-MM-dd-HH}.log 
 PatternLayout pattern=%date{-MM-dd HH:mm:ss.SSS} %level 
 [%thread][%file:%line] - %msg%n / PoliciesTimeBasedTriggeringPolicy 
 interval=1 modulate=true / /Policies/FastRollingFile!-- 游戏产品数据分析日志 
 --FastRollingFile name=ProductLog 
 fileName={SERVER_NAME}_{LOG_HOME}/{STAT_NAME}.%d{-MM-dd-HH}.log 
 PatternLayoutpattern=%date{-MM-dd HH:mm:ss.SSS} %level 
 [%thread][%file:%line] - %msg%n / PoliciesTimeBasedTriggeringPolicy 
 interval=1 modulate=true / /Policies/FastRollingFile /appenders 
 loggers!-- 3rdparty Loggers --logger name=org.springframework.core 
 level=info/loggerlogger name=org.springframework.beans 
 level=info/loggerlogger name=org.springframework.context 
 level=info/loggerlogger name=org.springframework.web 
 level=info/loggerlogger name=org.jboss.netty 
 level=warn/loggerlogger name=org.apache.http 
 level=warn/logger!-- Game Stat logger --logger 
 name=com.u9.global.service.log level=info additivity=false 
 appender-ref ref=ProductLog //logger!-- Root Logger --root 
 level=DEBUG appender-ref ref=DevLog / appender-ref ref=Console 
 //root /loggers/configuration
 
 when I run my project ,it works ok in eclipse,everything print ok in console. 
 however,when i compile the project to jar ,and run it by start.bat ,log4j2 
 can.t print output in cmd window,i can't catch the reason,pls help me. thank 
 you!


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

.