This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Capture logs to file via log4j.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Capture logs to file via log4j.xml" Watch "Capture logs to file via log4j.xml" New topic
Author

Capture logs to file via log4j.xml

sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 70
Hi, Here is my log4j.xml code. But there is no Log file that gets generated. Please help
<appender name="MYLOGFILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="X:/ListOperationLogs.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="123000KB" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1}: %m%n"/>
</layout>
</appender>


<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<param name="Threshold" value="ERROR"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Messagen -->
<!--
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-->
<param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L) -%m%n"/>
</layout>
</appender>

<root>
<level value="DEBUG"/>
<appender-ref ref="MYLOGFILE"/>

</root>

</log4j:configuration>
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You are probably using that file in a context where the X: drive is not mapped to anything.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Moving to Other Open Source Projects.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 70
Thanks for your replies guys,
But X: Drive is a drive on my machine. Before X: i had tried with giving desktop location and no location as well. There was no file generated
I cant move to other open sources coz of Project Compulsions


Could you help looking at the source code??

Thanks
Sandeep
 
 
subject: Capture logs to file via log4j.xml
 
Similar Threads
getting errors I can't explain...anyone can help out ?
How to use log4j.jdbcplus.JDBCAppender in log4j.xml
Odd validation error in log4j.xml
How to supress SQL Queries in log file
How to monitor log file in jboss for sending mails,when error or excetion found in log