Ok, now I see, it seems you are using a custom Appender called 
translogfile


here is an example of how a custom appender would have a log4j.properties
file setup


Steps

1) Import required classes:

import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.LoggingEvent;

2) Declare your class:

public class MyAppender extends AppenderSkeleton{

3) If you need extra parameters, declare them:

    private String Text3;
    private int Value1;
    private int Value2;

4) Declare methods to manage your parameters:

    public void setText3(String text3) {
        Text3 = text3;
    }

    public String getText3() {
        return Text3;
    }

    public void setValue1(int value1) {
        Value1 = value1;
    }

    public int getValue1() {
        return Value1;
    }

5) You must declare this method:

    public boolean requiresLayout() {
        return false;
    }

    public void close() {
    }

6) And the main method of your implementation:

    protected void append(LoggingEvent event) {
        String level=event.getLevel().toString();
        String event.getMessage().toString();
    }

The main method enables you to get the log (event.getMessage().toString())
and other data. With this data you can send the log to another application.

7) To use the log in your application, you can use this log4j.properties
sample:

log4j.appender.mylog=MyAppender
log4j.appender.mylog.Text2=text2
log4j.appender.mylog.Text3=text3
log4j.appender.mylog.Value1=1
log4j.appender.mylog.Value2=2
log4j.appender.mylog.Value3=3

log4j.rootCategory=info, mylog  


Hope this helps.


-Kamal.
-----Original Message-----
From: venkat_74 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 03, 2007 4:21 PM
To: [email protected]
Subject: Re: log4j - Daily Rolling File Appenders




> Hi dirk,
> 
> Thanks for your reply, it was useful.
> But when I was trying to set the file name for the lastest file using 
> log4j.appender.translogfile.scheduledFilename=somename
> it reports no such property when my server is started, what am I missing
> here.
> 
> Meena
> 
> 
> AFAIK, you can not configure this, but typically one will run a cron job
> that 
> deletes the log files that are older than N days.
> 
> 
-- 
View this message in context:
http://www.nabble.com/log4j---Daily-Rolling-File-Appenders-tf2915974.html#a8
148945
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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