You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Jacob Kjome <ho...@visi.com> on 2006/01/27 18:10:11 UTC

Re: questions regarding log4j console prints and rolling file appender

Quoting Sumit Kumar <su...@novell.com>:

> Hi Devs,
>
> I am using log4j alpha6 for logging. Quite good, but still facing few
> problems and need you help ..
>
> 1. While configure, there were many messages printed on the console. I
> set LogLog.setQuiteMode(true) and many of the messages gone away. But
> still there are few messages printed on the console.
> As I am developing a CLI, I can not afford any such messages on the
> console.
> Here are the messages printed:
>
> *** configurationOptionStr=log4j.properties
> ** End of LogManager static initializer
> (there are direct SOPs .. can we comment them out .. or use logger to
> do so)
>
> 0 [main] WARN org.apache.log4j.config.PropertySetter - No such property
> [storeLocation] in org.apache.log4j.Hierarchy.
> 1 [main] WARN org.apache.log4j.config.PropertySetter - No such property
> [logStyle] in org.apache.log4j.Hierarchy.
> (Here xyz is the variable I am using for configuring some property of
> my own and not related to log4j .However I feel there must be some way
> to stop printing such messages on the console.)
>

This is the case for Log4j-1.3 alphas less than 7.  You need to upgrade.  The
forced logging was there for debugging purposes in the development of
Log4j-1.3.  They are removed in alpha7.  Alpha 8 is now out.  You should move
to that.

http://cvs.apache.org/builds/logging/log4j/log4j-1.3a8/

> 2. I am extending RollingFileAppender to customize it for my purpose.
> However this class is final in alpha-7 and 8 builds.
> Can we make it extensible ??
>

I'm not sure where this landed or if a final decision has been made.  Lots of
work is going into making Logj4-1.3 binary compatible with 1.2.  But I'm not
sure if some of the wrapper classes are going to be removed.  I suggest looking
in at the classes in the "rolling" package and extending one of those.

Jake

> Any suggestion/help is welcomed ...
> Sumit
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: questions regarding log4j console prints and rolling file appender

Posted by Curt Arnold <ca...@apache.org>.
On Jan 28, 2006, at 2:56 AM, Sumit Kumar wrote:

> Thanks for solving out first Issue for me.
> However the thing which stopped me to move for alpha7 or greater is
> org.apache.log4j.rolling.RollingFileAppender is a final class in them
> and hence is not extensible.
> Its good enough for me if some one can make it extensible in alpha -8,
> gives me all reasons to move for alpha 8 !!

The behavior of o.a.l.rolling.RollingFileAppender is customizable by  
replacing the triggering policy and rolling policy objects.  Those  
are the anticipated extension points.  Please explain what type of  
behavior change you are trying to achieve.  If they can't be  
accomplished through the either the triggering policy or rolling  
policy, then we can consider modifying TriggeringPolicy or  
RollingPolicy, provide yet another extension point or (unlikely)  
removing the final keyword.

For background on why final is our friend, see items 14 and 15 in  
"Effective Java".

  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: questions regarding log4j console prints and rolling file appender

Posted by Sumit Kumar <su...@novell.com>.
Thanks for solving out first Issue for me.
However the thing which stopped me to move for alpha7 or greater is
org.apache.log4j.rolling.RollingFileAppender is a final class in them
and hence is not extensible.
Its good enough for me if some one can make it extensible in alpha -8,
gives me all reasons to move for alpha 8 !! 

Regards
Sumit

>>> On Fri, Jan 27, 2006 at 10:40 pm, in message
<11...@my.visi.com>, hoju@visi.com wrote: 
> Quoting Sumit Kumar <su...@novell.com>:
> 
>> Hi Devs,
>>
>> I am using log4j alpha6 for logging. Quite good, but still facing
few
>> problems and need you help ..
>>
>> 1. While configure, there were many messages printed on the console.
I
>> set LogLog.setQuiteMode(true) and many of the messages gone away.
But
>> still there are few messages printed on the console.
>> As I am developing a CLI, I can not afford any such messages on the
>> console.
>> Here are the messages printed:
>>
>> *** configurationOptionStr=log4j.properties
>> ** End of LogManager static initializer
>> (there are direct SOPs .. can we comment them out .. or use logger
to
>> do so)
>>
>> 0 [main] WARN org.apache.log4j.config.PropertySetter -  No such
property
>> [storeLocation] in org.apache.log4j.Hierarchy.
>> 1 [main] WARN org.apache.log4j.config.PropertySetter -  No such
property
>> [logStyle] in org.apache.log4j.Hierarchy.
>> (Here xyz is the variable I am using for configuring some property
of
>> my own and not related to log4j .However I feel there must be some
way
>> to stop printing such messages on the console.)
>>
> 
> This is the case for Log4j- 1.3 alphas less than 7.  You need to
upgrade.  The
> forced logging was there for debugging purposes in the development
of
> Log4j- 1.3.  They are removed in alpha7.  Alpha 8 is now out.  You
should move
> to that.
> 
> http://cvs.apache.org/builds/logging/log4j/log4j- 1.3a8/
> 
>> 2. I am extending RollingFileAppender to customize it for my
purpose.
>> However this class is final in alpha- 7 and 8 builds.
>> Can we make it extensible ??
>>
> 
> I'm not sure where this landed or if a final decision has been made. 
Lots 
> of
> work is going into making Logj4- 1.3 binary compatible with 1.2.  But
I'm not
> sure if some of the wrapper classes are going to be removed.  I
suggest 
> looking
> in at the classes in the "rolling" package and extending one of
those.
> 
> Jake
> 
>> Any suggestion/help is welcomed ...
>> Sumit
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e- mail: log4j- dev- unsubscribe@logging.apache.org
>> For additional commands, e- mail: log4j- dev-
help@logging.apache.org
>>
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e- mail: log4j- dev- unsubscribe@logging.apache.org
> For additional commands, e- mail: log4j- dev-
help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org