thank you very ,it seems OK now!



------------------ ???????? ------------------
??????: "Jacob Kjome";<[email protected]>;
????????: 2013??9??10??(??????) ????11:00
??????: "Log4J Users List"<[email protected]>; 

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




As I stated before, you need to place a period (".") in the manifest.mf 
Class-Path in order to load resources outside the current jar or jars 
referenced in the Class-Path.  For instance...

Class-Path: . lib/antlr-2.7.6.jar lib/other.jar

That period will place the current directory (the one containing test.jar and 
log4j2.xml) in the classpath and, therefore, allow Log4j2 to locate the 
log4j2.xml config file.


Jake

On Tue, 10 Sep 2013 07:01:41 +0800
 "?????Y" <[email protected]> wrote:
> anybody know why?
> 
> ---????????---
> ?? 2013??09??09?? 20:55:40
> "41157121"<[email protected]> ??????
> 
> 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";<[email protected]>;
> ????????: 2013??9??8??(??????) ????11:53
> ??????: "Log4J Users List"<[email protected]>; 
> 
> ????: 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);
>> 
>> 
>> 
>> 
>> ------------------ ???????? ------------------
>> ??????: "????";<[email protected]>;
>> ????????: 2013??9??8??(??????) ????11:32
>> ??????: "log4j-user-info"<[email protected]>; 
>>"log4j-user-faq"<[email protected]>; 
>>"log4j-user"<[email protected]>; 
>> 
>> ????: 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"> <properties><property 
>>name="LOG_HOME">/log/fish</property><!-- ???????????? --><property 
>>name="BACKUP_HOME">{LOG_HOME}/backup</property><property 
>>name="STAT_NAME">stat</property><property 
>>name="SERVER_NAME">global</property> </properties> <appenders><!-- 
>>?????????????? 
>>--><Console name="Console" target="SYSTEM_OUT"> <PatternLayout 
>>pattern="%date{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - 
>>%msg%n" /></Console><!-- ?????????????? --><FastRollingFile name="DevLog" 
>>fileName="{SERVER_NAME}" filePattern="{SERVER_NAME}.%d{yyyy-MM-dd-HH}.log"> 
>><PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss.SSS} %level 
>>[%thread][%file:%line] - %msg%n" /> <Policies><TimeBasedTriggeringPolicy 
>>interval="1" modulate="true" /> </Policies></FastRollingFile><!-- 
>>???????????????????? 
>>--><FastRollingFile name="ProductLog" 
>>fileName="{SERVER_NAME}_{LOG_HOME}/{STAT_NAME}.%d{yyyy-MM-dd-HH}.log"> 
>><PatternLayoutpattern="%date{yyyy-MM-dd HH:mm:ss.SSS} %level 
>>[%thread][%file:%line] - %msg%n" /> <Policies><TimeBasedTriggeringPolicy 
>>interval="1" modulate="true" /> </Policies></FastRollingFile> </appenders> 
>><loggers><!-- 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: [email protected]
>For additional commands, e-mail: [email protected]
> 
> .


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

.

Reply via email to