File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes LOG4J Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "LOG4J" Watch "LOG4J" New topic
Author

LOG4J

Govardhan Balaji
Greenhorn

Joined: Aug 24, 2009
Posts: 5
hi,
Using log4j log messages should be sent to a file. consider i am writing some ten messages in the file , when a 11th messages comes it should replace the 1st message in the that file than remaining 9 messages(from 2 to 10) should not be deleted. Also for the 11th message it should not create a new file(Rolling file appender). I have written the code for sending the log messages to a file but don't know how to implement that file requirement. Please help me to solve this issue
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

Govardhan,
Welcome to the Ranch.

I do not think that is possible, only by tweaking log4j properties. You might have to do the cleanup stuff with some java file i/o code.
We have a dedicated forum where log4j is usually discussed. I will move this thread there for you.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Govardhan Balaji
Greenhorn

Joined: Aug 24, 2009
Posts: 5
Thanks for your reply. Will you provide the link when you move this thread.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

The posts are internally linked to be redirected. Such posts will carry this icon
Anyway, you need not worry about the link. Clicking on the original post will take you automatically to the new place.
As you can see, your post is now in the "Other Open Source Projects" forum.
Govardhan Balaji
Greenhorn

Joined: Aug 24, 2009
Posts: 5
Ya after posting the reply only i have noticed that. Sorry i have created a new topic,Can you delete that new topic
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Can you delete that new topic

Removed.


[My Blog]
All roads lead to JavaRanch
Govardhan Balaji
Greenhorn

Joined: Aug 24, 2009
Posts: 5
Thanks
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10051
    
163

Looking at the requirement, it's surely going to confuse those who will be using the logs to identify any issues. Why do you want it that way?


[My Blog] [JavaRanch Journal]
Govardhan Balaji
Greenhorn

Joined: Aug 24, 2009
Posts: 5
This was the requirement given to me. What to do?.
 
Consider Paul's rocket mass heater.
 
subject: LOG4J