I want to say up front that I am not a developer and know enough to brake
some stuff. lol

I have a software package from a vendor that ships the tomcat web server
with it. Below are my environment details:

1) The tomcat version that is running is v8.0.26.0
2) The OS is a Centos v7 UNIX VM
3) Java JDK I have installed that Tomcat is using is 1.8.0_60
4) The vendor has the $CATALINA_HOME and CATALINA_BASE as the same location
which is <Install_directory>/server
5) The <Install_directory>/server directory is the place where the /lib,
/bin, /conf, and etc.directory's are found.
6) Due to the catalina.out file growing too large with the default
juli.AsyncFileHandler using the logging.properties file that was found in
the $CATALINA_HOME/conf directory. I changed it to use the log4j logging.
Here are the steps I did to make this happen which I found on Tomcat 8 web
site:

          a. Downloaded log4j-1.2.17.jar and placed it in $CATALINA_HOME/lib
          b. Downloaded from the Tomcat extras web page for Tomcat 8 the
tomcat-juli-adapters.jar and the tomcat-juli.jar.
          c. Deleted the old tomcat-juli.jar out of the $CATALINA_HOME/bin
directory.
          d. Placed the new tomcat-juli.jar file and the
tomcat-juli-adapters.jar file in to the $CATALINA_HOME/bin directory.
          e. Deleted the old logging.properties file from the
$CATALINA_HOME/conf directory.
           f. Created the log4j.properties file in the $CATALINA_HOME/lib
directory and copied the settings that are shown on the Tomcat 8 logging
web page that has been there for Tomcat 7 logging web page too that
everyone is familiar with. Here is the url just incase:
https://tomcat.apache.org/tomcat-8.0-doc/logging.html

I know the log4j.properties files is being used as I made 2 changes to the
config file that were taken. One changes was to actually verify the
log4j.properties file was being used, which was changed the word INFO to
OFF for localhost file messages being written by editing the following line
at the bottom of the log4j.properties file:

log4j.logger.org.apache.catalina,core.ConainerBase.[Catalina].[localhost] =
OFF, LOCALHOST

The other change I made was I changed the file name in the following line
to read catalina.out instead of catalina:
log4j.appender,CATALINA.File = ${catalina.base}/logs/catalina.out

The reason I did this was I thought the daily roll that was supposed to
take place at midnight would occur on the file that was named catalina and
not on the file that was named catalina.out. All the INFO messages being
written to the file named catalina were also being written to the
catalina.out file which was the one I wanted to roll daily anyway so I
thought this change would be fine.

I stopped tomcat and cleared all the logs out and left the server to run
over night. (It is still running now) and it appears the roll did not take
place. What I woke up to was everything you see below found in the
$CATALINA_HOME/logs directory except for the one file written today which
was due to me logging in to the web application that the vendor supports so
I could verify I could still login and use the software:

-rw-r--r--.  root  root  33003 Nov 18 21:03 catalina.out
-rw-r--r--.  root  root         0 Nov 18 21:03 host-manager
-rw-r--r--.  root  root         0 Nov 18 21:03 localhost
-rw-r--r--.  root  root         0 Nov 18 21:03
localhost_access_log.2015-11-18.txt
-rw-r--r--.  root  root    2498 Nov 19 13:23
localhost_access_log.2015-11-19.txt
-rw-r--r--.  root  root         0 Nov 18 21:03 manager

I don't know what I am missing from the configs to make the catalina.out
file roll each day at midnight. Some help would be greatly appreciated.

Also, no I cannot contact the vendor as they just tell me to hire a
professional. So I am the professional.

And, no I don't want to use the RollingFileAppender as I need the roll over
to be based on day and not the size of catalina.out.

I do see when the application starts and in the catalina.out it records the
following which I don't know if it should read something else for the log4j
logging to be used:

-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

I'm digging and don't know where else to look and am probably not looking
in the right places.

Any Help is greatly appreciated. I think I am close.

Reply via email to