Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wierd logging issue with my app

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this related to log4j in particular?
 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic