2013/11/13 Shashank Gvs <shashankgvs...@gmail.com>:
> 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.
>
>  <path id="tomcat.classpath">
>                 <fileset dir="${tomcat.dir}/lib/">
>                         <patternset>
>                                 <include name="**/*.jar" />
>                                 <include name="**/*.zip" />
>                         </patternset>
>                 </fileset>

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.

>                 <pathelement location="${tomcat.dir}/bin/bootstrap.jar" />
>                 <pathelement location="${tomcat.dir}/bin/tomcat-juli.jar" />
>         </path>
>  <target name="tomcat-start" depends="tomcat-check-status"
> unless="tomcat.started">
>  <java classname="org.apache.catalina.startup.Bootstrap" fork="true"
> spawn="true" classpathref="tomcat.classpath">
>                         <jvmarg
> value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
>                         <jvmarg
> value="-Djava.util.logging.config.file=${tomcat.dir}/conf/logging.properties"
> />
>                         <jvmarg value="-Dcatalina.base=${tomcat.dir}"/>
>
>                         <jvmarg value="-Xms${host.jvm.heap.min}" />
>                         <jvmarg value="-Xmx${host.jvm.heap.max}" />
>                         <jvmarg value="-XX:PermSize=${host.jvm.perm.min}"/>
>                         <jvmarg
> value="-XX:MaxPermSize=${host.jvm.perm.max}" />
>                         <jvmarg value="-Dcatalina.home=${tomcat.dir}" />
>                         <jvmarg
> value="-Dcom.sun.management.jmxremote.port=1099"/>
>                         <jvmarg
> value="-Dcom.sun.management.jmxremote.ssl=false"/>
>                         <jvmarg
> value="-Dcom.sun.management.jmxremote.authenticate=false"/>
>
>                 </java>
> </target>
>
>
> 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

Reply via email to