File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes General Computing and the fly likes wierd logging issue with my app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "wierd logging issue with my app" Watch "wierd logging issue with my app" New topic
Author

wierd logging issue with my app

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
I have two machines in office. One is PC and the other is desktop which I got recently.
I have installed same application (my java code) on both the machines. The servers installed are identical.
on my PC when I run my application locally , the log files get created correctly. But on my desktop with same settings the logs do not get created. I compared my classpath and other settings on both the machines for the same application. Nothing seems different. IS there any computer related settings that is rejecting the logs getting created for my application on the desktop. I am running out of any solution to this problem.
With my app, in the log4J config file , I just specify the location for logs directory. I checked the spelling and the path on the desktop and everything seems to be in order.

any pointers?

thanks
Trupti
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Is this related to log4j in particular?


SCJP, SCWCD.
|Asking Good Questions|
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
NO.

But somehow the files are not getting created.
In log4j xml file I just set the location where logs needs to be stored.

here is my file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "./dtds/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<!-- Declare fileAppender -->
<appender name="fileAppender" class="com.domain.util.TRFRollingFileAppender">
<param name="MaxFileSize" value="150MB"/>
<param name="file" value="C:/myapp225dev5/logs/adapter/{yyyy-MM-dd}-RouterName_Adapter-{hh-mm}.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{MM/dd|HH:mm:ss.SSS}|myApp|%-5p|%c{2}|%X{clientIP}|%m%n"/>
</layout>
</appender>
<!-- Declare AsyncAppender -->
<appender name="asycAppender" class="org.apache.log4j.AsyncAppender">
<param name="BufferSize" value="100000"/>
<param name="blocking" value="false"/>
<appender-ref ref="fileAppender"/>
<!-- <appender-ref ref="emailAppender"/> -->
</appender>


<logger name="com.xxx.yyy" additivity="false">
<level value="debug"/>
<appender-ref ref="asycAppender"/>
</logger>

<logger name="com.xxx.sss" additivity="false">
<level value="debug"/>
<appender-ref ref="asycAppender"/>
</logger>

<logger name="com.xxx.aaa" additivity="false">
<level value="debug"/>
<appender-ref ref="asycAppender"/>
</logger>

<root>
<priority value="DEBUG"/>
</root>

</log4j:configuration>

thanks
trupti
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
HI all,

I found the issue .
I downloaded the log4j jar and put it in my classpath on my desktop and now I see the logs are getting created. my only confusion is why it's working on my pc when no log4j.jar is in classpth on the pc?

For now the issue is resolved.

thanks
trupti
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: wierd logging issue with my app