You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Tasso The Developer <ja...@hotmail.com> on 2005/02/04 19:21:29 UTC
Filtering out data while logging
Problem is it's a string received from a 3rd party... With it's on custom
format...
_________________________________________________________________
Take charge with a pop-up guard built on patented MicrosoftŽ SmartScreen
Technology.
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSNŽ Premium right now and get the
first two months FREE*.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
RE: is log4j printing out class/method name expensive?
Posted by Ceki Gülcü <ce...@qos.ch>.
Anil,
I was not tying to sell you anything. The answer to your question is
readily available. See javadocs for PatternLayout. I hope this helps,
At 06:12 PM 2/7/2005, Anil Philip wrote:
>Ceki,
>I dont understand your reply. Are you pointing me to buy your book - in the
>signature at the end - so I can get the answer? :(
>Thanks,
>Anil
--
Ceki Gülcü
The complete log4j manual: http://www.qos.ch/log4j/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Log File Name !!
Posted by shirish <sh...@india.infogain.com>.
----- Original Message -----
From: "Jacob Kjome" <ho...@visi.com>
To: "Log4J Users List" <lo...@logging.apache.org>; <jm...@nerim.net>
Sent: Wednesday, February 23, 2005 11:36 PM
Subject: Re: Log File Name !!
> Quoting jerome moliere <jm...@nerim.net>:
>
>>
>> > I think RollingFileAppender does that except that it does it by size,
>> > not by run.
Could whatever starts your program rename the log files
>> > before starting?
Yes the java client itself has to rename the existing logfile before writing
the new file.
>>
>> I guess that you could use the RoolingFileAppender from the JBOSS group,
>> because it delivers in standard the exact feature expected!!!
>>
>
> Of course, it would be nice if the JBOSS group would contribute this work
> back
> to the Log4j project so everyone could use it from one source, but I
> digress....
>
> I don't recall all the functionality of rolling policies/triggering
> policies in
> Log4j-1.3, but I'm sure someting like this could be accomodated. The
> rolling
> policies are much more flexible in Log4j-1.3 than any of the specific the
> RollingFileAppenders were in Log4j-1.2. Maybe Ceki can fill in the gaps
> here?
> In any case, take a look at the 1.3 RollingFileAppender javadoc for more
> details.
>
>
> Jake
>
>
>> HTH
>> Jerome
>> > shirish <sh...@india.infogain.com> wrote:
>> >> Hi,
>> >>
>> >> I have a reqmt for a stand alone java client to output the log to a
>> >> log
>> >> file.
>> >> This log file should be created per run of the java client.
>> >> The earlier log file should be renamed with an incremental integer
>> >>
>> >> for e.g
>> >>
>> >> applog.log is already existing
>> >> next run of the client should generate applog.log and rename the
>> >> earlier
>> >> applog.log to applog1.log and so on .
>> >>
>> >> Can this be done through log4j
>> >>
>> >> Regards...
>> >
>> > --
>> > James Stauffer
>> > http://www.geocities.com/stauffer_james/
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> > For additional commands, e-mail: log4j-user-help@logging.apache.org
>> >
>> >
>>
>>
>> --
>> Auteur cahier du programmeur J2EE - Decembre 2004
>>
> http://www.amazon.fr/exec/obidos/ASIN/2212115741/qid=1105361289/sr=1-1/ref=sr_1_8_1/171-9571438-3966654
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Log File Name !!
Posted by Jacob Kjome <ho...@visi.com>.
Quoting jerome moliere <jm...@nerim.net>:
>
> > I think RollingFileAppender does that except that it does it by size,
> > not by run. Could whatever starts your program rename the log files
> > before starting?
> >
>
> I guess that you could use the RoolingFileAppender from the JBOSS group,
> because it delivers in standard the exact feature expected!!!
>
Of course, it would be nice if the JBOSS group would contribute this work back
to the Log4j project so everyone could use it from one source, but I
digress....
I don't recall all the functionality of rolling policies/triggering policies in
Log4j-1.3, but I'm sure someting like this could be accomodated. The rolling
policies are much more flexible in Log4j-1.3 than any of the specific the
RollingFileAppenders were in Log4j-1.2. Maybe Ceki can fill in the gaps here?
In any case, take a look at the 1.3 RollingFileAppender javadoc for more
details.
Jake
> HTH
> Jerome
> > shirish <sh...@india.infogain.com> wrote:
> >> Hi,
> >>
> >> I have a reqmt for a stand alone java client to output the log to a log
> >> file.
> >> This log file should be created per run of the java client.
> >> The earlier log file should be renamed with an incremental integer
> >>
> >> for e.g
> >>
> >> applog.log is already existing
> >> next run of the client should generate applog.log and rename the earlier
> >> applog.log to applog1.log and so on .
> >>
> >> Can this be done through log4j
> >>
> >> Regards...
> >
> > --
> > James Stauffer
> > http://www.geocities.com/stauffer_james/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>
> --
> Auteur cahier du programmeur J2EE - Decembre 2004
>
http://www.amazon.fr/exec/obidos/ASIN/2212115741/qid=1105361289/sr=1-1/ref=sr_1_8_1/171-9571438-3966654
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Log File Name !!
Posted by jerome moliere <jm...@nerim.net>.
> I think RollingFileAppender does that except that it does it by size,
> not by run. Could whatever starts your program rename the log files
> before starting?
>
I guess that you could use the RoolingFileAppender from the JBOSS group,
because it delivers in standard the exact feature expected!!!
HTH
Jerome
> shirish <sh...@india.infogain.com> wrote:
>> Hi,
>>
>> I have a reqmt for a stand alone java client to output the log to a log
>> file.
>> This log file should be created per run of the java client.
>> The earlier log file should be renamed with an incremental integer
>>
>> for e.g
>>
>> applog.log is already existing
>> next run of the client should generate applog.log and rename the earlier
>> applog.log to applog1.log and so on .
>>
>> Can this be done through log4j
>>
>> Regards...
>
> --
> James Stauffer
> http://www.geocities.com/stauffer_james/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
--
Auteur cahier du programmeur J2EE - Decembre 2004
http://www.amazon.fr/exec/obidos/ASIN/2212115741/qid=1105361289/sr=1-1/ref=sr_1_8_1/171-9571438-3966654
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Log File Name !!
Posted by James Stauffer <st...@gmail.com>.
I think RollingFileAppender does that except that it does it by size,
not by run. Could whatever starts your program rename the log files
before starting?
shirish <sh...@india.infogain.com> wrote:
> Hi,
>
> I have a reqmt for a stand alone java client to output the log to a log
> file.
> This log file should be created per run of the java client.
> The earlier log file should be renamed with an incremental integer
>
> for e.g
>
> applog.log is already existing
> next run of the client should generate applog.log and rename the earlier
> applog.log to applog1.log and so on .
>
> Can this be done through log4j
>
> Regards...
--
James Stauffer
http://www.geocities.com/stauffer_james/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Log File Name !!
Posted by shirish <sh...@india.infogain.com>.
Hi,
I have a reqmt for a stand alone java client to output the log to a log
file.
This log file should be created per run of the java client.
The earlier log file should be renamed with an incremental integer
for e.g
applog.log is already existing
next run of the client should generate applog.log and rename the earlier
applog.log to applog1.log and so on .
Can this be done through log4j
Regards...
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
RE: is log4j printing out class/method name expensive?
Posted by Anil Philip <an...@openwave.com>.
Ceki,
I dont understand your reply. Are you pointing me to buy your book - in the
signature at the end - so I can get the answer? :(
Thanks,
Anil
-----Original Message-----
From: Ceki Gülcü [mailto:ceki@qos.ch]
Sent: Monday, February 07, 2005 11:08 AM
To: Log4J Users List
Subject: Re: is log4j printing out class/method name expensive?
Anil,
The statement is only partial and hence incorrect.
At 05:47 PM 2/7/2005, you wrote:
>"Log4j can print both class & method name, but in an expensive way. It
>creates a Throwable object, dumps the stack to a String, and then parses
the
>string to get the class/method name. As some of our applications requires
>high throughput, we need to try to avoid unnecessary CPU cycles."
>
>Hello,
>Someone made this statement and I wondered if it is true.
>If I write logger.info("hello"); does it do this each time?
>Thanks,
>Anil Philip
--
Ceki Gülcü
The complete log4j manual: http://www.qos.ch/log4j/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: is log4j printing out class/method name expensive?
Posted by Ceki Gülcü <ce...@qos.ch>.
Anil,
The statement is only partial and hence incorrect.
At 05:47 PM 2/7/2005, you wrote:
>"Log4j can print both class & method name, but in an expensive way. It
>creates a Throwable object, dumps the stack to a String, and then parses the
>string to get the class/method name. As some of our applications requires
>high throughput, we need to try to avoid unnecessary CPU cycles."
>
>Hello,
>Someone made this statement and I wondered if it is true.
>If I write logger.info("hello"); does it do this each time?
>Thanks,
>Anil Philip
--
Ceki Gülcü
The complete log4j manual: http://www.qos.ch/log4j/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
multi-threading and log4j - bottleneck?
Posted by Anil Philip <an...@openwave.com>.
Hello,
If I have several threads running in a process; they may share a logger or
have separate loggers. But they all write to one log file.
e.g. logger.info();
Since log4j output to the file is quite neat even though interleaving
happens, I wondered if it uses file locks or synchronizes and if threads
waiting on this would create a bottleneck. Or is it asynchronous - the
threads simply write to a buffer and return and the buffer is written out
later (though writing to the buffer is synchronized)?
Thanks,
Anil Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
is log4j printing out class/method name expensive?
Posted by Anil Philip <an...@openwave.com>.
"Log4j can print both class & method name, but in an expensive way. It
creates a Throwable object, dumps the stack to a String, and then parses the
string to get the class/method name. As some of our applications requires
high throughput, we need to try to avoid unnecessary CPU cycles."
Hello,
Someone made this statement and I wondered if it is true.
If I write logger.info("hello"); does it do this each time?
Thanks,
Anil Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org