logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Norbert Toth-Gati" <norbert.tothg...@gmail.com>
Subject Re: Changing log name???
Date Thu, 18 May 2006 11:35:42 GMT
So follow this:

public class YourAppender extends org.apache.log4j.RollingFileAppender {

public void setFile(final String filename) {
        String year = Integer.toString(Calendar.getInstance().get(
Calendar.YEAR));
        String month = Integer.toString(Calendar.getInstance().get(
Calendar.MONTH));
        String day = Integer.toString(Calendar.getInstance().get(
Calendar.DAY_OF_MONTH));
        String actualDate = day + "-" + month + "-" +  year + "-";
        String newFileName += actualDate + filename;
  super.setFile(newFilename);
}
}

Regards
Norbert

On 5/18/06, Kailash KN <kailash_kn@thbs.com> wrote:
>
> Thanks Norbert, but i have no clue as to how i implement, as mentioned
> earlier i have wasted two days on it, and finally i gave up, did'nt wanna
> waste time on it again!!! :-)
>
> If you could help me with it, i'd be grateful!!! :-)
>
> Thanks & Regards,
> Kailash.K.N.
> # 71, 4th Floor,
> Sona Towers, Miller's Road,
> Bangalore - 560 052
> email : kailash_kn@yahoo.com
> Ph : +91-9886634958
>         +91-80-41327370
> URL: www.thbs.com
> ----- Original Message -----
> From: "Norbert Toth-Gati" <norbert.tothgati@gmail.com>
> To: "Log4J Users List" <log4j-user@logging.apache.org>
> Sent: Thursday, May 18, 2006 4:23 PM
> Subject: Re: Changing log name???
>
>
> >I think this is not supported yet by log4j version 1.2.x, so you should
> > create your own implementation, extending RollingFileAppender.
> >
> > Regards
> > Norbert
> >
> > On 5/18/06, Kailash KN <kailash_kn@thbs.com> wrote:
> >>
> >>  Hi,
> >> Attached is the log4j.xml document, in which the name of the debug file
> >> is
> >> "*debug.log*", but i want the file to be name as
> >> *"dd-mm-YYYY-debug.log".*How do i achieve this??? I'm stuck with this
> for
> >> almost 2 days now. Plz help
> >> me out.
> >>
> >> Thanks & Regards,
> >> Kailash
> >>
> >> ******* DISCLAIMER: This email and any files transmitted with it are
> >> privileged and confidential information and intended solely for the use
> >> of
> >> the individual or entity to which they are addressed. If you are not
> the
> >> intended recipient, please notify the sender by e-mail and delete the
> >> original message. Further, you are not to copy, disclose, or distribute
> >> this
> >> e-mail or its contents to any other person and any such actions are
> >> unlawful. This e-mail may contain viruses. Torry Harris Business
> >> Solutions
> >> has taken every reasonable precaution to minimize this risk, but is not
> >> liable for any damage you may sustain as a result of any virus in this
> >> e-mail.  The recipient should check this email and any attachments for
> >> the
> >> presence of viruses. THBS reserves the right to monitor and review the
> >> content of all messages sent to or from this e-mail address********
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>
> >>
> >>
> >
>
>
>
> ******* DISCLAIMER: This email and any files transmitted with it are
> privileged and confidential information and intended solely for the use of
> the individual or entity to which they are addressed. If you are not the
> intended recipient, please notify the sender by e-mail and delete the
> original message. Further, you are not to copy, disclose, or distribute this
> e-mail or its contents to any other person and any such actions are
> unlawful. This e-mail may contain viruses. Torry Harris Business Solutions
> has taken every reasonable precaution to minimize this risk, but is not
> liable for any damage you may sustain as a result of any virus in this
> e-mail.  The recipient should check this email and any attachments for the
> presence of viruses. THBS reserves the right to monitor and review the
> content of all messages sent to or from this e-mail address********
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message