Re: Regd: Logging issue in apache tomcat 7.0.42

2013-11-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Shashank,

On 11/13/13, 12:49 AM, Shashank Gvs wrote:
> I wanted to have logging in tomcat, but currently using 
> juli/java.util.logging i am having a file with date in it (for
> example catalina.11.12.2013.log) , i am unable to remove date as my
> additional requirement is that i have to include daily rollover of
> the file.
> 
> Alternatively i have tried this using log4j by following the
> documentation. I was able to get the log working properly if i
> start my tomcat using startup,sh. But i am starting tomcat from an
> ant script in the following way which is not at all forming the
> log. Can i be helped on this.
> 
>   
>/>location="${tomcat.dir}/bin/bootstrap.jar" />  location="${tomcat.dir}/bin/tomcat-juli.jar" />   name="tomcat-start" depends="tomcat-check-status" 
> unless="tomcat.started">  classname="org.apache.catalina.startup.Bootstrap" fork="true" 
> spawn="true" classpathref="tomcat.classpath">

Why not simply call catalina.sh from ant?

For example, this is my "tomcat-start" target (it's verbose, but useful):

  











  




===
Starting Tomcat
===
JAVA_HOME is ${app.java-home}
JAVA_OPTS is ${effective.JAVA_OPTS}
CATALINA_HOME is ${app.tomcat-home}
CATALINA_BASE is ${app.home.dir}
CATALINA_OPTS is ${effective.CATALINA_OPTS}
security-option is '${security-option}'



  
  
  
  

  
  




  
  
  
  
  

  
  

  

Now I don't have to worry about things like proper CLASSPATH, updating
my script when some launch parameter changes, etc.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.15 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJShCu5AAoJEBzwKT+lPKRY+osQAI2Mvcw0auW06C65/BYslr6W
aQm/QIky88XphE3IwgMrRc02FClEHA2Rz/fKQK/qqxgF3BPIUKMJaBpVFb3oJJwQ
7dHV1rDOyDfZJFPZyAnKzyxT99Rn4PolRd1ds5ZB5tfqFrHN+TePFkLxejVUAV/d
Pqf7+1cikHQGqm81EY2itBEWMMGRQwUwFrPD0C4Z8glsUElx62TB7iKTY4CGO3Ea
jxjFCe1bw/fzcGfeWxOshWXdrk8DtzwuHYUhnVfice8TRteQJyBWnCO+A3zFpTr1
C5uBEIKfGOx3A0pW2weP/Y+p9+Ur+xW4mDF/8soh66EUDdHJrH0qgndkfXtPf/6x
ZGLQdgV/wm0FJqkPcJ46aiOs7BGGDq4Ku5f+brWPHtO4sJiPjro5hshCmIZAoXyM
/47TyrwyUsd2eQ7F4m4gxsy3Bx6W6gWNG2OI6Bhs5PyI3i+r5f3O0Z9iOslQwT0O
sMLZb9w/2dpv4nIzF3T1p/IrNA7a80+m17rAfxnyFQZvV2jUajm2Aowffe+H+HAH
WUbNSX0cn7bEv9J7N/84qhsPTtKwwLRdwEF+9r5rdun0HLdWihl7CvloF7ZHjQ3G
jrsD5qsu7pUgB7xJDrnD5bv1B2eMMfFGlSnpNhsaCBdwyyFjJj6/OeDyTkdDga0r
oK6HmV6cQa0Tinq8NNMd
=+334
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regd: Logging issue in apache tomcat 7.0.42

2013-11-13 Thread Konstantin Kolinko
2013/11/13 Shashank Gvs :
> Hi,
>
> I wanted to have logging in tomcat, but currently using
> juli/java.util.logging i am having a file with date in it (for example
> catalina.11.12.2013.log) , i am unable to remove date as my additional
> requirement is that i have to include daily rollover of the file.

There are two ways to disable rollover (and thus the date in the filename):

a) There is property in JULI FileHandler to disable rollover.
b) You can use FileHandler class from JDK instead of JULI one.

> Alternatively i have tried this using log4j by following the documentation.
> I was able to get the log working properly if i start my tomcat using
> startup,sh. But i am starting tomcat from an ant script in the following
> way which is not at all forming the log. Can i be helped on this.
>
>  
> 
> 
> 
> 
> 
> 

The above is wrong.

The Bootstrap class should locate & load libraries by itself (thanks
to configuration in conf/catalina.properties). The above puts the
libraries in the System classloader, which is wrong.

http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html

One more error in the above:
note that Tomcat configuration for Common classloader includes not
only "lib/*.jar" but also "lib/" directory itself.

Your configuration includes *.jar files only. Class files and
resources (such as the log4j configuration file) will not be seen by
libraries loaded with the above System classloader configuration.

The below is OK.

> 
> 
> 
>   unless="tomcat.started">
>   spawn="true" classpathref="tomcat.classpath">
>  value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
>  value="-Djava.util.logging.config.file=${tomcat.dir}/conf/logging.properties"
> />
> 
>
> 
> 
> 
>  value="-XX:MaxPermSize=${host.jvm.perm.max}" />
> 
>  value="-Dcom.sun.management.jmxremote.port=1099"/>
>  value="-Dcom.sun.management.jmxremote.ssl=false"/>
>  value="-Dcom.sun.management.jmxremote.authenticate=false"/>
>
> 
> 
>
>
> Any help is appreciated.
>
> Thanks & Regards,
> Shashank

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org