1.2.16 with broken OSGi Import-Package?

2010-07-08 Thread Lars Fischer
Hello,

I would like to use log4j 1.2.16 inside an eclipse OSGi project and
tried to add the log4j-1.2.16.jar to my target platform.
But the jar is not recognized as OSGi bundle.

I discovered, that the reason is a doubled Import-Package entry of
com.sun.jdmk.comm;resolution:=optional in the MANIFEST.MF. This
prevents the jar from being loaded into the target platform. :(

I can remove one of the entries by hand. With this change the jar can
be added. But this is no good solution for me.

Could someone confirm that this is a bug in 1.2.16?

Kind regards,
Lars

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: log4j

2010-07-08 Thread Jacob Kjome
When -Dlog4j.debug=true is set, Log4j prints its configuration progress to 
System.err.  With this, you should be able to see which config file is being 
picked up.


You can run your appender at a specified time by not placing log4j.properties 
in the classpath.  But then you'll have to manually configure it at some later 
point.


Note that if you also place a log4j.jar with WEB-INF/lib and another Log4j 
config file in WEB-INF/classes of your webapp, you will get a separate logger 
repository from the server containing a different configuration.  If you 
remove your config file from WEB-INF/classes, you'll still have a separate 
logger repository from the server but use the same config as the server.


Jake

On Thu, 8 Jul 2010 10:21:39 +0530
 Kaushal Shriyan kaushalshri...@gmail.com wrote:

On Wed, Jul 7, 2010 at 8:28 PM, Jacob Kjome h...@visi.com wrote:


Where did you put log4j.properties?  For Tomcat 5.5.xx, it should be in
CATALINA_HOME/common/classes.

Try adding the following to CATALINA_OPTS

-Dlog4j.debug=true

Jake


Hi Jake

Thanks for the quick reply. is there a way to run log4j appender at a
specified time?

log4j.rootLogger=INFO, R
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/catalina.out
log4j.appender.R.DatePattern='.'-MM-dd
log4j.appender.R.layout=org.apache.log4j.PatternLayout

I have put the log4j.properties under /opt/tomcat0/common/classes and
have added -Dlog4j.debug=true under CATALINA_OPTS variable.
where do i look for the debug logs.

Please suggest.

Thanks and Regards

Kaushal

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: log4j

2010-07-08 Thread Kaushal Shriyan
On Thu, Jul 8, 2010 at 5:48 PM, Jacob Kjome h...@visi.com wrote:
 When -Dlog4j.debug=true is set, Log4j prints its configuration progress to
 System.err.  With this, you should be able to see which config file is being
 picked up

Thanks Jake.

Thanks, I could see it on catalina.out file where in system.out and
system.err files goes.

 You can run your appender at a specified time by not placing
 log4j.properties in the classpath.  But then you'll have to manually
 configure it at some later point.

Please help me understand by providing examples.

Basically if i set log4j.appender.R.DatePattern='.'-MM-dd in
log4j.properties It rolls over at midnight. is there a way to roll
over at say 12:00 Noon afternoon

Please suggest/guide further

Thanks, Kaushal

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: log4j

2010-07-08 Thread Jacob Kjome

On Thu, 8 Jul 2010 17:59:23 +0530
 Kaushal Shriyan kaushalshri...@gmail.com wrote:

On Thu, Jul 8, 2010 at 5:48 PM, Jacob Kjome h...@visi.com wrote:

When -Dlog4j.debug=true is set, Log4j prints its configuration progress to
System.err.  With this, you should be able to see which config file is being
picked up


Thanks Jake.

Thanks, I could see it on catalina.out file where in system.out and
system.err files goes.


You can run your appender at a specified time by not placing
log4j.properties in the classpath.  But then you'll have to manually
configure it at some later point.


Please help me understand by providing examples.

Basically if i set log4j.appender.R.DatePattern='.'-MM-dd in
log4j.properties It rolls over at midnight. is there a way to roll
over at say 12:00 Noon afternoon



Oh, I see.  Sorry, I thought you were asking if you could delay instantiation 
of your appender.  Rather, you want to define when it rolls.  See:


http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

As you can see, DailyRollingFileAppender is somewhat lacking in flexibility.  
You may have more luck with the Log4j-extras companion [1].  Specifically, 
RollingFileAppender [2] with a TimeBasedRollingPolicy [3].


[1] http://logging.apache.org/log4j/companions/extras/index.html
[2] 
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html
[3] 
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html



Jake


Please suggest/guide further

Thanks, Kaushal

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: log4j

2010-07-08 Thread Kaushal Shriyan
On Thu, Jul 8, 2010 at 6:14 PM, Jacob Kjome h...@visi.com wrote:
 On Thu, 8 Jul 2010 17:59:23 +0530
  Kaushal Shriyan kaushalshri...@gmail.com wrote:

 On Thu, Jul 8, 2010 at 5:48 PM, Jacob Kjome h...@visi.com wrote:

 When -Dlog4j.debug=true is set, Log4j prints its configuration progress
 to
 System.err.  With this, you should be able to see which config file is
 being
 picked up

 Thanks Jake.

 Thanks, I could see it on catalina.out file where in system.out and
 system.err files goes.

 You can run your appender at a specified time by not placing
 log4j.properties in the classpath.  But then you'll have to manually
 configure it at some later point.

 Please help me understand by providing examples.

 Basically if i set log4j.appender.R.DatePattern='.'-MM-dd in
 log4j.properties It rolls over at midnight. is there a way to roll
 over at say 12:00 Noon afternoon


 Oh, I see.  Sorry, I thought you were asking if you could delay
 instantiation of your appender.  Rather, you want to define when it rolls.
 See:

 http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

 As you can see, DailyRollingFileAppender is somewhat lacking in
 flexibility.  You may have more luck with the Log4j-extras companion [1].
 Specifically, RollingFileAppender [2] with a TimeBasedRollingPolicy [3].

 [1] http://logging.apache.org/log4j/companions/extras/index.html
 [2]
 http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html
 [3]
 http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html


 Jake

Jake,

I referred to 
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html
it has only two options

/wombat/folder/foo.%d (Daily rollover (at midnight). Due to the
omission of the optional time and date pattern for the %d token
specifier, the default pattern of -MM-dd is assumed, which
corresponds to daily rollover.)

/wombat/foo.%d{-MM}.log (Rollover at the beginning of each month.)

Not sure though how it would fit it into my specific needs.

Apologies for bugging

Please suggest/further

Thanks and Regards

Kaushal

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: log4j

2010-07-08 Thread Jacob Kjome

On Thu, 8 Jul 2010 18:32:31 +0530
 Kaushal Shriyan kaushalshri...@gmail.com wrote:

On Thu, Jul 8, 2010 at 6:14 PM, Jacob Kjome h...@visi.com wrote:

On Thu, 8 Jul 2010 17:59:23 +0530
 Kaushal Shriyan kaushalshri...@gmail.com wrote:


On Thu, Jul 8, 2010 at 5:48 PM, Jacob Kjome h...@visi.com wrote:


When -Dlog4j.debug=true is set, Log4j prints its configuration progress
to
System.err.  With this, you should be able to see which config file is
being
picked up


Thanks Jake.

Thanks, I could see it on catalina.out file where in system.out and
system.err files goes.


You can run your appender at a specified time by not placing
log4j.properties in the classpath.  But then you'll have to manually
configure it at some later point.


Please help me understand by providing examples.

Basically if i set log4j.appender.R.DatePattern='.'-MM-dd in
log4j.properties It rolls over at midnight. is there a way to roll
over at say 12:00 Noon afternoon



Oh, I see.  Sorry, I thought you were asking if you could delay
instantiation of your appender.  Rather, you want to define when it rolls.
See:

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

As you can see, DailyRollingFileAppender is somewhat lacking in
flexibility.  You may have more luck with the Log4j-extras companion [1].
Specifically, RollingFileAppender [2] with a TimeBasedRollingPolicy [3].

[1] http://logging.apache.org/log4j/companions/extras/index.html
[2]
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html
[3]
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html


Jake


Jake,

I referred to 
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html

it has only two options

/wombat/folder/foo.%d (Daily rollover (at midnight). Due to the
omission of the optional time and date pattern for the %d token
specifier, the default pattern of -MM-dd is assumed, which
corresponds to daily rollover.)

/wombat/foo.%d{-MM}.log (Rollover at the beginning of each month.)

Not sure though how it would fit it into my specific needs.



You're not reading closely enough.  The first example leaves off the optional 
time and date.  The second example leaves off the optional time.  Using the 
optional time is the key.


The Logback docs contain some more documentation on the 
TimeBasedRollingPolicy, which shows some time configuration.  That said, it 
doesn't provide an example for using a specific time of day.  You might want 
to post a separate thread on the Log4j-user list or even the Logback list to 
see if someone knows the proper syntax.  It seems like it should be possible.


http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy

You should be able to go by this documentation as both the Log4j-extras and 
Logback implementations have the same origin: the discontinued Log4j 1.3 
effort.



Jake


Apologies for bugging

Please suggest/further

Thanks and Regards

Kaushal

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: 1.2.16 with broken OSGi Import-Package?

2010-07-08 Thread Curt Arnold
There was a duplicated package in the import declarations which caused the 
manifest to be rejected.  It should be fixed in the SVN HEAD.


On Jul 8, 2010, at 6:18 AM, Lars Fischer wrote:

 Hello,
 
 I would like to use log4j 1.2.16 inside an eclipse OSGi project and
 tried to add the log4j-1.2.16.jar to my target platform.
 But the jar is not recognized as OSGi bundle.
 
 I discovered, that the reason is a doubled Import-Package entry of
 com.sun.jdmk.comm;resolution:=optional in the MANIFEST.MF. This
 prevents the jar from being loaded into the target platform. :(
 
 I can remove one of the entries by hand. With this change the jar can
 be added. But this is no good solution for me.
 
 Could someone confirm that this is a bug in 1.2.16?
 
 Kind regards,
 Lars
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org