You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joleen Barker <ol...@gmail.com> on 2015/11/19 21:19:45 UTC

Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

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.

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
Chris,

Here are my log4j settings. These are the same settings that have been
posted on the Tomcat web site for v6, 7, and I think 8 for users, I didn't
change anything here as it seemed like it was just supposed to roll at
midnight based on the DatePattern configurations.

log4j.rootLogger=INFO, CATALINA

# Define all the appenders
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.File=${catalina.base}/logs/catalina.
log4j.appender.CATALINA.Append=true
log4j.appender.CATALINA.Encoding=UTF-8
# Roll-over the log once per day
log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout
log4j.appender.CATALINA.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

log4j.appender.LOCALHOST=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOCALHOST.File=${catalina.base}/logs/localhost.
log4j.appender.LOCALHOST.Append=true
log4j.appender.LOCALHOST.Encoding=UTF-8
log4j.appender.LOCALHOST.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.LOCALHOST.layout = org.apache.log4j.PatternLayout
log4j.appender.LOCALHOST.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

log4j.appender.MANAGER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MANAGER.File=${catalina.base}/logs/manager.
log4j.appender.MANAGER.Append=true
log4j.appender.MANAGER.Encoding=UTF-8
log4j.appender.MANAGER.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.MANAGER.layout = org.apache.log4j.PatternLayout
log4j.appender.MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

log4j.appender.HOST-MANAGER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.HOST-MANAGER.File=${catalina.base}/logs/host-manager.
log4j.appender.HOST-MANAGER.Append=true
log4j.appender.HOST-MANAGER.Encoding=UTF-8
log4j.appender.HOST-MANAGER.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.HOST-MANAGER.layout = org.apache.log4j.PatternLayout
log4j.appender.HOST-MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Encoding=UTF-8
log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

# Configure which loggers log to which appenders
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO,
LOCALHOST
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]=\
  INFO, MANAGER
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]=\
  INFO, HOST-MANAGER


On Mon, Nov 30, 2015 at 7:32 AM, Joleen Barker <ol...@gmail.com>
wrote:

> Hi Chris,
>
> I will send the log4 details but I wanted to send this information first.
> The above details for the files remained the same all this time until I
> decided to login to the software and try to do some work. I had expected
> the files to roll at midnight each night which I did not see. But, long
> behold I run an ls -la command and the logs after I logged in and tried a
> couple things on the software and it appears the logs roll over and a new
> catalina log and localhost log started. Does some activity need to take
> place for the logs to roll over? I thought it was supposed to be each night
> at midnight. Also the dates of the files are a little misleading because
> they rolled today and not on 11-25 when they started up.
>
> Here is what I see now:
>
> -rw-r--r--.  root  root  24372 Nov 30 06:33 catalina
> -rw-r--r--.  root  root  30694 Nov 25 22:49 catalina.2015-11-25.log
> -rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
> -rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
> -rw-r--r--.  root  root  24372 Nov 30 06:33  localhost
> -rw-r--r--.  root  root  31909 Nov 25 22:49  localhost.2015-11-25.log
> -rw-r--r--.  root  root         0 Nov 25 22:49
>  localhost_access_log.2015-11-25.txt
> -rw-r--r--.  root  root  25988 Nov 30 06:34
>  localhost_access_log.2015-11-30.txt
> -rw-r--r--.  root  root         0 Nov 25 22:49  manager
> [root@centos7sys1 logs]# date
> Thu Nov 30 07:27:39 EST 2015
>
> -Joleen
>
> On Thu, Nov 26, 2015 at 1:29 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> Joleen,
>>
>> On 11/26/15 12:12 AM, Joleen Barker wrote:
>> > Alas, no luck. This is what I found in my directory:
>> >
>> > -rw-r--r--.  root  root  30694 Nov 25 22:49 catalina
>> > -rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
>> > -rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
>> > -rw-r--r--.  root  root  31909 Nov 25 22:49  localhost
>> > -rw-r--r--.  root  root         0 Nov 25 22:49
>> >  localhost_access_log.2015-11-25.txt
>> > -rw-r--r--.  root  root         0 Nov 25 22:49  manager
>> > [root@centos7sys1 logs]# date
>> > Thu Nov 26 00:07:25 EST 2015
>>
>> So, those two files are growing without bound? Is the date on the
>> server/JVM the same as what you expect? I have some servers in UTC and
>> others in America/New_York and sometimes I get confused when the dates
>> roll-over at times I'm not expecting.
>>
>> What does your log4j configuration look like?
>>
>> -chris
>>
>> > On Wed, Nov 25, 2015 at 7:22 PM, Joleen Barker <oldenuf2nobtr@gmail.com
>> >
>> > wrote:
>> >
>> >> I changed it back to use the log4j setting as I liked it better and the
>> >> boss wants the files to rollover at midnight each night. Now when I
>> startup
>> >> the catalina.out file is empty and the logs appear to be split between
>> the
>> >> catalina file (not catalina.out) and the localhost file. Some of the
>> >> messages are doubled between the two files.
>> >>
>> >>
>> >> We will see what happens now with the swallowOutput=true. I'm so
>> excited
>> >> to see what is there tomorrow morning. lol
>> >>
>> >> -Joleen
>> >>
>> >> On Wed, Nov 25, 2015 at 6:59 PM, Joleen Barker <
>> oldenuf2nobtr@gmail.com>
>> >> wrote:
>> >>
>> >>> Sorry. I all of a sudden noticed the swallowOutput="false" in the
>> >>> cfcc.xml I had. I changed this to be true and now it appears most of
>> the
>> >>> messages are being written to the locahost file. I don't see any
>> messages
>> >>> missing. I will leave it run over night and see what happens and
>> report
>> >>> tomorrow.
>> >>>
>> >>> -Joleen
>> >>>
>> >>> On Wed, Nov 25, 2015 at 3:50 PM, Joleen Barker <
>> oldenuf2nobtr@gmail.com>
>> >>> wrote:
>> >>>
>> >>>> I didn't get too far. For the option b and setting the
>> >>>> swallowOutput=true in right place I need to get some clarification.
>> >>>>
>> >>>> I was looking up more information about the swallowOutput parm so I
>> >>>> understood more. In Christopher's comments he spoke about updating
>> the
>> >>>> context xml. This is where I am confused. When I think of the word
>> >>>> "context" it has always referring to the vendors web page to log in
>> with
>> >>>> and the context set is "cfcc". There is a file named cfcc.xml in the
>> >>>> <Install_directory>/server/conf/Catalina/localhost directory. Then
>> there is
>> >>>> the actual context.xml file located in the
>> <Install_directory>/server/conf
>> >>>> directory. I am not sure which one I would put the swallowOutput
>> parm in.
>> >>>> Maybe it would be both.
>> >>>>
>> >>>> The only items in the context.xml file that are not commented out are
>> >>>> the following settings and it's a pretty small file:
>> >>>>
>> >>>> <Context>
>> >>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>> >>>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>> >>>> ...
>> >>>> ...
>> >>>> <Manager pathname="" />
>> >>>> ...
>> >>>> ...
>> >>>> <Valve
>> >>>> classname="org.apache.catalina.valves.CometConnectionManagerValve" />
>> >>>> </Context>
>> >>>>
>> >>>> The cfcc.xml file that I have has the following:
>> >>>>
>> >>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> >>>> <Context cachingAllowed="true"
>> >>>> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>> >>>> className="org.apache.catalina.core.StandardContext" cookies="true"
>> >>>> crossContext="false" debug="0" displayName="Secure Internet File
>> Transfer
>> >>>> Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
>> >>>> mapperClass="org.apache.catalina.core.StandardContextMapper"
>> path="/cfcc"
>> >>>> privileged="false" reloadable="false" swallowOutput="false"
>> >>>> useHttpOnly="false" useNaming="true"
>> >>>> wrapperClass="org.apache.catalina.core.StandardWrapper">
>> >>>> <Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
>> >>>> <Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
>> >>>> <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
>> >>>> directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
>> >>>> suffix=".txt" timestamp="true" verbosity="2"/>
>> >>>> <Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
>> >>>> connectionName="cfcc"
>> connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
>> >>>> connectionURL="jdbc:mysql://
>> >>>> 192.168.1.7:3306/mft730?characterEncoding=UTF8" debug="0"
>> digest="SHA"
>> >>>> driverName="com.mysql.jdbc.Driver" roleNameCol="RoleID"
>> >>>> userCredCol="Passwd" userNameCol="UserID" userRoleTable="UsersMap"
>> >>>> userTable="Users" validate="true"/>
>> >>>> <Resource auth="Container" name="jdbc/sift" scope="Shareable"
>> >>>> type="javax.sql.DataSource"/>
>> >>>> </Context>
>> >>>>
>> >>>> Thank you.
>> >>>>
>> >>>> -Joleen
>> >>>>
>> >>>>
>> >>>> On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <
>> oldenuf2nobtr@gmail.com
>> >>>>> wrote:
>> >>>>
>> >>>>> Thank you for some direction.
>> >>>>>
>> >>>>> I'll go ahead and put back the logging as it was from the vendor
>> using
>> >>>>> the logging.properties file, etc. etc. so as to minimize their lack
>> of
>> >>>>> support due to me changing a lot in their product.
>> >>>>>
>> >>>>> Then I'll go on to try option b.
>> >>>>>
>> >>>>> I'll report back with how it goes.
>> >>>>>
>> >>>>> -Joleeb
>> >>>>> Joleen,
>> >>>>>
>> >>>>> On 11/24/15 4:31 PM, Joleen Barker wrote:
>> >>>>>> I have setup the logrotate using cron in the past and it was very
>> >>>>>> successful on the Linux boxes but I could not find an equivalent
>> >>>>> setup for
>> >>>>>> AIX. Things seem so much easier on Linux. The company wants a
>> >>>>> universal
>> >>>>>> approach so that left that option out.
>> >>>>>
>> >>>>> Only some things are easier on Linux.
>> >>>>>
>> >>>>> This may help:
>> >>>>> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
>> >>>>>
>> >>>>>> I did see the section you copied in from the catalina.sh file but
>> >>>>> couldnt
>> >>>>>> make much out from it so I left it alone.
>> >>>>>>
>> >>>>>> I like the sound of option b. I know where the context xml file is.
>> >>>>> (Under
>> >>>>>> the Catalina/localhost/<context>.xml) Im not sure if this is what
>> you
>> >>>>> mean
>> >>>>>> by descriptor.
>> >>>>>
>> >>>>> Yup, that's the one. Just add the swallowOutput setting and restart
>> the
>> >>>>> web application. (Or restart Tomcat if that's easier for you.)
>> >>>>>
>> >>>>>> If I did this would I leave the log4j config changes that I
>> >>>>>> have in place that already?
>> >>>>>
>> >>>>> No, you wouldn't have to use log4j at all. JULI can do log-rotation
>> as
>> >>>>> well, though the options aren't as nice as log4j. Log4j is a really
>> >>>>> great logging system, actually.
>> >>>>>
>> >>>>> -chris
>> >>>>>
>> >>>>>
>> ---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>> >>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Joleen,

On 11/30/15 11:44 AM, Joleen Barker wrote:
> OMG!!! Finally. I feel like I can go back to the bosses with some progress.
> This is all good news. Also, thanks for the correction on the "lo and
> behold", I never knew that. I have to laugh at myself.

Sometimes, this list can be more of a grammar and etiquette support
group than anything else. Glad I could help.

> I can change the catalina file name to the name catalina.log, I think you
> are right and it be less confusing.
> 
> Yes, nothing is going to catalina.out anymore.
> 
> In the production environment there is almost always activity so then the
> new catalina.log file will be rollover pretty close to midnight every day.

It should. As many issues are not reproducible in dev/test that plague
production, at the very least production gets much more activity, so
this issue shouldn't come up too often. You could even write a script to
ping your server once every hour on the :01 to trip the log file if you
were very worried about it.

> Now I'm really excited about implementing these changes in our big test
> environment that has a lot of activity. My little system at home is not
> used as much so I didn't get to experience the rollover. But I learned a
> lot from this experience.
> 
> I will want to build from this setup to attempting to control what data is
> written where as right now there is a lot of duplicate information going to
> both the catalina and localhost file but I think it would be a separate
> email stream.

Right. For this, you'll want to look at setting the configuration for
each web application, like this:

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/your-web-app]=INFO,
SOME_NEW_APPENDER

This will keep it from going to the CATALINA appender, which is the
default logger in the most-recent configuration you posted to the list.

Good luck,
-chris

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


Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
OMG!!! Finally. I feel like I can go back to the bosses with some progress.
This is all good news. Also, thanks for the correction on the "lo and
behold", I never knew that. I have to laugh at myself.

I can change the catalina file name to the name catalina.log, I think you
are right and it be less confusing.

Yes, nothing is going to catalina.out anymore.

In the production environment there is almost always activity so then the
new catalina.log file will be rollover pretty close to midnight every day.

Now I'm really excited about implementing these changes in our big test
environment that has a lot of activity. My little system at home is not
used as much so I didn't get to experience the rollover. But I learned a
lot from this experience.

I will want to build from this setup to attempting to control what data is
written where as right now there is a lot of duplicate information going to
both the catalina and localhost file but I think it would be a separate
email stream.

Thank you so much for the help Christpher.

-Joleen

On Mon, Nov 30, 2015 at 10:26 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> Joleen,
>
> On 11/30/15 7:32 AM, Joleen Barker wrote:
> > I will send the log4 details but I wanted to send this information first.
> > The above details for the files remained the same all this time until I
> > decided to login to the software and try to do some work. I had expected
> > the files to roll at midnight each night which I did not see. But, long
> > behold
>
> N.B. This is usually said "lo and behold". [1]
>
> > I run an ls -la command and the logs after I logged in and tried a
> > couple things on the software and it appears the logs roll over and a new
> > catalina log and localhost log started. Does some activity need to take
> > place for the logs to roll over?
>
> Yes. The documentation suggests otherwise, but the appender won't
> actually re-name the file and open a new one until it gets a write
> operation after midnight had occurred. So it's possible to entirely skip
> a day if there are no logging events that are sent to the appender. I'm
> not sure if it will re-name and re-open when an event comes /and is
> filtered/ (e.g. by a LEVEL that is too high for the logging-event) or
> only when a log message will actually be written to the file.
>
> > I thought it was supposed to be each night at midnight. Also the
> > dates of the files are a little misleading because they rolled today
> > and not on 11-25 when they started up.
>
> Right, the creation-timestamp of the new file will be the time that the
> file was created, not 00:00 at the beginning of the day when you thought
> it should be created.
>
> > Here is what I see now:
> >
> > -rw-r--r--.  root  root  24372 Nov 30 06:33 catalina
> > -rw-r--r--.  root  root  30694 Nov 25 22:49 catalina.2015-11-25.log
> > -rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
>
> So it looks like catalina.out has nothing in it anymore. That's good,
> right? Nothing is going to stderr/stdout.
>
> > -rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
> > -rw-r--r--.  root  root  24372 Nov 30 06:33  localhost
> > -rw-r--r--.  root  root  31909 Nov 25 22:49  localhost.2015-11-25.log
> > -rw-r--r--.  root  root         0 Nov 25 22:49
> >  localhost_access_log.2015-11-25.txt
> > -rw-r--r--.  root  root  25988 Nov 30 06:34
> localhost_access_log.2015-11-30
> > .txt
> > -rw-r--r--.  root  root         0 Nov 25 22:49  manager
> > [root@centos7sys1 logs]# date
> > Thu Nov 30 07:27:39 EST 2015
>
> The file "catalina" (which you might want to name catalina.log or
> something, so it's less confusing) will always have the date of the
> most-recent log message written to it.
>
> Hope that helps,
> -chris
>
> [1] http://idioms.thefreedictionary.com/lo+and+behold
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Joleen,

On 11/30/15 7:32 AM, Joleen Barker wrote:
> I will send the log4 details but I wanted to send this information first.
> The above details for the files remained the same all this time until I
> decided to login to the software and try to do some work. I had expected
> the files to roll at midnight each night which I did not see. But, long
> behold

N.B. This is usually said "lo and behold". [1]

> I run an ls -la command and the logs after I logged in and tried a
> couple things on the software and it appears the logs roll over and a new
> catalina log and localhost log started. Does some activity need to take
> place for the logs to roll over?

Yes. The documentation suggests otherwise, but the appender won't
actually re-name the file and open a new one until it gets a write
operation after midnight had occurred. So it's possible to entirely skip
a day if there are no logging events that are sent to the appender. I'm
not sure if it will re-name and re-open when an event comes /and is
filtered/ (e.g. by a LEVEL that is too high for the logging-event) or
only when a log message will actually be written to the file.

> I thought it was supposed to be each night at midnight. Also the
> dates of the files are a little misleading because they rolled today
> and not on 11-25 when they started up.

Right, the creation-timestamp of the new file will be the time that the
file was created, not 00:00 at the beginning of the day when you thought
it should be created.

> Here is what I see now:
> 
> -rw-r--r--.  root  root  24372 Nov 30 06:33 catalina
> -rw-r--r--.  root  root  30694 Nov 25 22:49 catalina.2015-11-25.log
> -rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out

So it looks like catalina.out has nothing in it anymore. That's good,
right? Nothing is going to stderr/stdout.

> -rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
> -rw-r--r--.  root  root  24372 Nov 30 06:33  localhost
> -rw-r--r--.  root  root  31909 Nov 25 22:49  localhost.2015-11-25.log
> -rw-r--r--.  root  root         0 Nov 25 22:49
>  localhost_access_log.2015-11-25.txt
> -rw-r--r--.  root  root  25988 Nov 30 06:34  localhost_access_log.2015-11-30
> .txt
> -rw-r--r--.  root  root         0 Nov 25 22:49  manager
> [root@centos7sys1 logs]# date
> Thu Nov 30 07:27:39 EST 2015

The file "catalina" (which you might want to name catalina.log or
something, so it's less confusing) will always have the date of the
most-recent log message written to it.

Hope that helps,
-chris

[1] http://idioms.thefreedictionary.com/lo+and+behold

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


Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
Hi Chris,

I will send the log4 details but I wanted to send this information first.
The above details for the files remained the same all this time until I
decided to login to the software and try to do some work. I had expected
the files to roll at midnight each night which I did not see. But, long
behold I run an ls -la command and the logs after I logged in and tried a
couple things on the software and it appears the logs roll over and a new
catalina log and localhost log started. Does some activity need to take
place for the logs to roll over? I thought it was supposed to be each night
at midnight. Also the dates of the files are a little misleading because
they rolled today and not on 11-25 when they started up.

Here is what I see now:

-rw-r--r--.  root  root  24372 Nov 30 06:33 catalina
-rw-r--r--.  root  root  30694 Nov 25 22:49 catalina.2015-11-25.log
-rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
-rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
-rw-r--r--.  root  root  24372 Nov 30 06:33  localhost
-rw-r--r--.  root  root  31909 Nov 25 22:49  localhost.2015-11-25.log
-rw-r--r--.  root  root         0 Nov 25 22:49
 localhost_access_log.2015-11-25.txt
-rw-r--r--.  root  root  25988 Nov 30 06:34  localhost_access_log.2015-11-30
.txt
-rw-r--r--.  root  root         0 Nov 25 22:49  manager
[root@centos7sys1 logs]# date
Thu Nov 30 07:27:39 EST 2015

-Joleen

On Thu, Nov 26, 2015 at 1:29 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> Joleen,
>
> On 11/26/15 12:12 AM, Joleen Barker wrote:
> > Alas, no luck. This is what I found in my directory:
> >
> > -rw-r--r--.  root  root  30694 Nov 25 22:49 catalina
> > -rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
> > -rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
> > -rw-r--r--.  root  root  31909 Nov 25 22:49  localhost
> > -rw-r--r--.  root  root         0 Nov 25 22:49
> >  localhost_access_log.2015-11-25.txt
> > -rw-r--r--.  root  root         0 Nov 25 22:49  manager
> > [root@centos7sys1 logs]# date
> > Thu Nov 26 00:07:25 EST 2015
>
> So, those two files are growing without bound? Is the date on the
> server/JVM the same as what you expect? I have some servers in UTC and
> others in America/New_York and sometimes I get confused when the dates
> roll-over at times I'm not expecting.
>
> What does your log4j configuration look like?
>
> -chris
>
> > On Wed, Nov 25, 2015 at 7:22 PM, Joleen Barker <ol...@gmail.com>
> > wrote:
> >
> >> I changed it back to use the log4j setting as I liked it better and the
> >> boss wants the files to rollover at midnight each night. Now when I
> startup
> >> the catalina.out file is empty and the logs appear to be split between
> the
> >> catalina file (not catalina.out) and the localhost file. Some of the
> >> messages are doubled between the two files.
> >>
> >>
> >> We will see what happens now with the swallowOutput=true. I'm so excited
> >> to see what is there tomorrow morning. lol
> >>
> >> -Joleen
> >>
> >> On Wed, Nov 25, 2015 at 6:59 PM, Joleen Barker <oldenuf2nobtr@gmail.com
> >
> >> wrote:
> >>
> >>> Sorry. I all of a sudden noticed the swallowOutput="false" in the
> >>> cfcc.xml I had. I changed this to be true and now it appears most of
> the
> >>> messages are being written to the locahost file. I don't see any
> messages
> >>> missing. I will leave it run over night and see what happens and report
> >>> tomorrow.
> >>>
> >>> -Joleen
> >>>
> >>> On Wed, Nov 25, 2015 at 3:50 PM, Joleen Barker <
> oldenuf2nobtr@gmail.com>
> >>> wrote:
> >>>
> >>>> I didn't get too far. For the option b and setting the
> >>>> swallowOutput=true in right place I need to get some clarification.
> >>>>
> >>>> I was looking up more information about the swallowOutput parm so I
> >>>> understood more. In Christopher's comments he spoke about updating the
> >>>> context xml. This is where I am confused. When I think of the word
> >>>> "context" it has always referring to the vendors web page to log in
> with
> >>>> and the context set is "cfcc". There is a file named cfcc.xml in the
> >>>> <Install_directory>/server/conf/Catalina/localhost directory. Then
> there is
> >>>> the actual context.xml file located in the
> <Install_directory>/server/conf
> >>>> directory. I am not sure which one I would put the swallowOutput parm
> in.
> >>>> Maybe it would be both.
> >>>>
> >>>> The only items in the context.xml file that are not commented out are
> >>>> the following settings and it's a pretty small file:
> >>>>
> >>>> <Context>
> >>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> >>>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> >>>> ...
> >>>> ...
> >>>> <Manager pathname="" />
> >>>> ...
> >>>> ...
> >>>> <Valve
> >>>> classname="org.apache.catalina.valves.CometConnectionManagerValve" />
> >>>> </Context>
> >>>>
> >>>> The cfcc.xml file that I have has the following:
> >>>>
> >>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> >>>> <Context cachingAllowed="true"
> >>>> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
> >>>> className="org.apache.catalina.core.StandardContext" cookies="true"
> >>>> crossContext="false" debug="0" displayName="Secure Internet File
> Transfer
> >>>> Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
> >>>> mapperClass="org.apache.catalina.core.StandardContextMapper"
> path="/cfcc"
> >>>> privileged="false" reloadable="false" swallowOutput="false"
> >>>> useHttpOnly="false" useNaming="true"
> >>>> wrapperClass="org.apache.catalina.core.StandardWrapper">
> >>>> <Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
> >>>> <Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
> >>>> <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
> >>>> directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
> >>>> suffix=".txt" timestamp="true" verbosity="2"/>
> >>>> <Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
> >>>> connectionName="cfcc"
> connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
> >>>> connectionURL="jdbc:mysql://
> >>>> 192.168.1.7:3306/mft730?characterEncoding=UTF8" debug="0"
> digest="SHA"
> >>>> driverName="com.mysql.jdbc.Driver" roleNameCol="RoleID"
> >>>> userCredCol="Passwd" userNameCol="UserID" userRoleTable="UsersMap"
> >>>> userTable="Users" validate="true"/>
> >>>> <Resource auth="Container" name="jdbc/sift" scope="Shareable"
> >>>> type="javax.sql.DataSource"/>
> >>>> </Context>
> >>>>
> >>>> Thank you.
> >>>>
> >>>> -Joleen
> >>>>
> >>>>
> >>>> On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <
> oldenuf2nobtr@gmail.com
> >>>>> wrote:
> >>>>
> >>>>> Thank you for some direction.
> >>>>>
> >>>>> I'll go ahead and put back the logging as it was from the vendor
> using
> >>>>> the logging.properties file, etc. etc. so as to minimize their lack
> of
> >>>>> support due to me changing a lot in their product.
> >>>>>
> >>>>> Then I'll go on to try option b.
> >>>>>
> >>>>> I'll report back with how it goes.
> >>>>>
> >>>>> -Joleeb
> >>>>> Joleen,
> >>>>>
> >>>>> On 11/24/15 4:31 PM, Joleen Barker wrote:
> >>>>>> I have setup the logrotate using cron in the past and it was very
> >>>>>> successful on the Linux boxes but I could not find an equivalent
> >>>>> setup for
> >>>>>> AIX. Things seem so much easier on Linux. The company wants a
> >>>>> universal
> >>>>>> approach so that left that option out.
> >>>>>
> >>>>> Only some things are easier on Linux.
> >>>>>
> >>>>> This may help:
> >>>>> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
> >>>>>
> >>>>>> I did see the section you copied in from the catalina.sh file but
> >>>>> couldnt
> >>>>>> make much out from it so I left it alone.
> >>>>>>
> >>>>>> I like the sound of option b. I know where the context xml file is.
> >>>>> (Under
> >>>>>> the Catalina/localhost/<context>.xml) Im not sure if this is what
> you
> >>>>> mean
> >>>>>> by descriptor.
> >>>>>
> >>>>> Yup, that's the one. Just add the swallowOutput setting and restart
> the
> >>>>> web application. (Or restart Tomcat if that's easier for you.)
> >>>>>
> >>>>>> If I did this would I leave the log4j config changes that I
> >>>>>> have in place that already?
> >>>>>
> >>>>> No, you wouldn't have to use log4j at all. JULI can do log-rotation
> as
> >>>>> well, though the options aren't as nice as log4j. Log4j is a really
> >>>>> great logging system, actually.
> >>>>>
> >>>>> -chris
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>>>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Joleen,

On 11/26/15 12:12 AM, Joleen Barker wrote:
> Alas, no luck. This is what I found in my directory:
> 
> -rw-r--r--.  root  root  30694 Nov 25 22:49 catalina
> -rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
> -rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
> -rw-r--r--.  root  root  31909 Nov 25 22:49  localhost
> -rw-r--r--.  root  root         0 Nov 25 22:49
>  localhost_access_log.2015-11-25.txt
> -rw-r--r--.  root  root         0 Nov 25 22:49  manager
> [root@centos7sys1 logs]# date
> Thu Nov 26 00:07:25 EST 2015

So, those two files are growing without bound? Is the date on the
server/JVM the same as what you expect? I have some servers in UTC and
others in America/New_York and sometimes I get confused when the dates
roll-over at times I'm not expecting.

What does your log4j configuration look like?

-chris

> On Wed, Nov 25, 2015 at 7:22 PM, Joleen Barker <ol...@gmail.com>
> wrote:
> 
>> I changed it back to use the log4j setting as I liked it better and the
>> boss wants the files to rollover at midnight each night. Now when I startup
>> the catalina.out file is empty and the logs appear to be split between the
>> catalina file (not catalina.out) and the localhost file. Some of the
>> messages are doubled between the two files.
>>
>>
>> We will see what happens now with the swallowOutput=true. I'm so excited
>> to see what is there tomorrow morning. lol
>>
>> -Joleen
>>
>> On Wed, Nov 25, 2015 at 6:59 PM, Joleen Barker <ol...@gmail.com>
>> wrote:
>>
>>> Sorry. I all of a sudden noticed the swallowOutput="false" in the
>>> cfcc.xml I had. I changed this to be true and now it appears most of the
>>> messages are being written to the locahost file. I don't see any messages
>>> missing. I will leave it run over night and see what happens and report
>>> tomorrow.
>>>
>>> -Joleen
>>>
>>> On Wed, Nov 25, 2015 at 3:50 PM, Joleen Barker <ol...@gmail.com>
>>> wrote:
>>>
>>>> I didn't get too far. For the option b and setting the
>>>> swallowOutput=true in right place I need to get some clarification.
>>>>
>>>> I was looking up more information about the swallowOutput parm so I
>>>> understood more. In Christopher's comments he spoke about updating the
>>>> context xml. This is where I am confused. When I think of the word
>>>> "context" it has always referring to the vendors web page to log in with
>>>> and the context set is "cfcc". There is a file named cfcc.xml in the
>>>> <Install_directory>/server/conf/Catalina/localhost directory. Then there is
>>>> the actual context.xml file located in the <Install_directory>/server/conf
>>>> directory. I am not sure which one I would put the swallowOutput parm in.
>>>> Maybe it would be both.
>>>>
>>>> The only items in the context.xml file that are not commented out are
>>>> the following settings and it's a pretty small file:
>>>>
>>>> <Context>
>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>>>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>>>> ...
>>>> ...
>>>> <Manager pathname="" />
>>>> ...
>>>> ...
>>>> <Valve
>>>> classname="org.apache.catalina.valves.CometConnectionManagerValve" />
>>>> </Context>
>>>>
>>>> The cfcc.xml file that I have has the following:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>>> <Context cachingAllowed="true"
>>>> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>>>> className="org.apache.catalina.core.StandardContext" cookies="true"
>>>> crossContext="false" debug="0" displayName="Secure Internet File Transfer
>>>> Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
>>>> mapperClass="org.apache.catalina.core.StandardContextMapper" path="/cfcc"
>>>> privileged="false" reloadable="false" swallowOutput="false"
>>>> useHttpOnly="false" useNaming="true"
>>>> wrapperClass="org.apache.catalina.core.StandardWrapper">
>>>> <Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
>>>> <Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
>>>> <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
>>>> directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
>>>> suffix=".txt" timestamp="true" verbosity="2"/>
>>>> <Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
>>>> connectionName="cfcc" connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
>>>> connectionURL="jdbc:mysql://
>>>> 192.168.1.7:3306/mft730?characterEncoding=UTF8" debug="0" digest="SHA"
>>>> driverName="com.mysql.jdbc.Driver" roleNameCol="RoleID"
>>>> userCredCol="Passwd" userNameCol="UserID" userRoleTable="UsersMap"
>>>> userTable="Users" validate="true"/>
>>>> <Resource auth="Container" name="jdbc/sift" scope="Shareable"
>>>> type="javax.sql.DataSource"/>
>>>> </Context>
>>>>
>>>> Thank you.
>>>>
>>>> -Joleen
>>>>
>>>>
>>>> On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <oldenuf2nobtr@gmail.com
>>>>> wrote:
>>>>
>>>>> Thank you for some direction.
>>>>>
>>>>> I'll go ahead and put back the logging as it was from the vendor using
>>>>> the logging.properties file, etc. etc. so as to minimize their lack of
>>>>> support due to me changing a lot in their product.
>>>>>
>>>>> Then I'll go on to try option b.
>>>>>
>>>>> I'll report back with how it goes.
>>>>>
>>>>> -Joleeb
>>>>> Joleen,
>>>>>
>>>>> On 11/24/15 4:31 PM, Joleen Barker wrote:
>>>>>> I have setup the logrotate using cron in the past and it was very
>>>>>> successful on the Linux boxes but I could not find an equivalent
>>>>> setup for
>>>>>> AIX. Things seem so much easier on Linux. The company wants a
>>>>> universal
>>>>>> approach so that left that option out.
>>>>>
>>>>> Only some things are easier on Linux.
>>>>>
>>>>> This may help:
>>>>> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
>>>>>
>>>>>> I did see the section you copied in from the catalina.sh file but
>>>>> couldnt
>>>>>> make much out from it so I left it alone.
>>>>>>
>>>>>> I like the sound of option b. I know where the context xml file is.
>>>>> (Under
>>>>>> the Catalina/localhost/<context>.xml) Im not sure if this is what you
>>>>> mean
>>>>>> by descriptor.
>>>>>
>>>>> Yup, that's the one. Just add the swallowOutput setting and restart the
>>>>> web application. (Or restart Tomcat if that's easier for you.)
>>>>>
>>>>>> If I did this would I leave the log4j config changes that I
>>>>>> have in place that already?
>>>>>
>>>>> No, you wouldn't have to use log4j at all. JULI can do log-rotation as
>>>>> well, though the options aren't as nice as log4j. Log4j is a really
>>>>> great logging system, actually.
>>>>>
>>>>> -chris
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>
>>>
>>
> 

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


Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
Alas, no luck. This is what I found in my directory:

-rw-r--r--.  root  root  30694 Nov 25 22:49 catalina
-rw-r--r--.  root  root         0 Nov 25 22:49 catalina.out
-rw-r--r--.  root  root         0 Nov 25 22:49  host-manager
-rw-r--r--.  root  root  31909 Nov 25 22:49  localhost
-rw-r--r--.  root  root         0 Nov 25 22:49
 localhost_access_log.2015-11-25.txt
-rw-r--r--.  root  root         0 Nov 25 22:49  manager
[root@centos7sys1 logs]# date
Thu Nov 26 00:07:25 EST 2015



On Wed, Nov 25, 2015 at 7:22 PM, Joleen Barker <ol...@gmail.com>
wrote:

> I changed it back to use the log4j setting as I liked it better and the
> boss wants the files to rollover at midnight each night. Now when I startup
> the catalina.out file is empty and the logs appear to be split between the
> catalina file (not catalina.out) and the localhost file. Some of the
> messages are doubled between the two files.
>
>
> We will see what happens now with the swallowOutput=true. I'm so excited
> to see what is there tomorrow morning. lol
>
> -Joleen
>
> On Wed, Nov 25, 2015 at 6:59 PM, Joleen Barker <ol...@gmail.com>
> wrote:
>
>> Sorry. I all of a sudden noticed the swallowOutput="false" in the
>> cfcc.xml I had. I changed this to be true and now it appears most of the
>> messages are being written to the locahost file. I don't see any messages
>> missing. I will leave it run over night and see what happens and report
>> tomorrow.
>>
>> -Joleen
>>
>> On Wed, Nov 25, 2015 at 3:50 PM, Joleen Barker <ol...@gmail.com>
>> wrote:
>>
>>> I didn't get too far. For the option b and setting the
>>> swallowOutput=true in right place I need to get some clarification.
>>>
>>> I was looking up more information about the swallowOutput parm so I
>>> understood more. In Christopher's comments he spoke about updating the
>>> context xml. This is where I am confused. When I think of the word
>>> "context" it has always referring to the vendors web page to log in with
>>> and the context set is "cfcc". There is a file named cfcc.xml in the
>>> <Install_directory>/server/conf/Catalina/localhost directory. Then there is
>>> the actual context.xml file located in the <Install_directory>/server/conf
>>> directory. I am not sure which one I would put the swallowOutput parm in.
>>> Maybe it would be both.
>>>
>>> The only items in the context.xml file that are not commented out are
>>> the following settings and it's a pretty small file:
>>>
>>> <Context>
>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>>> ...
>>> ...
>>> <Manager pathname="" />
>>> ...
>>> ...
>>> <Valve
>>> classname="org.apache.catalina.valves.CometConnectionManagerValve" />
>>> </Context>
>>>
>>> The cfcc.xml file that I have has the following:
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>> <Context cachingAllowed="true"
>>> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>>> className="org.apache.catalina.core.StandardContext" cookies="true"
>>> crossContext="false" debug="0" displayName="Secure Internet File Transfer
>>> Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
>>> mapperClass="org.apache.catalina.core.StandardContextMapper" path="/cfcc"
>>> privileged="false" reloadable="false" swallowOutput="false"
>>> useHttpOnly="false" useNaming="true"
>>> wrapperClass="org.apache.catalina.core.StandardWrapper">
>>> <Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
>>> <Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
>>> <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
>>> directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
>>> suffix=".txt" timestamp="true" verbosity="2"/>
>>> <Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
>>> connectionName="cfcc" connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
>>> connectionURL="jdbc:mysql://
>>> 192.168.1.7:3306/mft730?characterEncoding=UTF8" debug="0" digest="SHA"
>>> driverName="com.mysql.jdbc.Driver" roleNameCol="RoleID"
>>> userCredCol="Passwd" userNameCol="UserID" userRoleTable="UsersMap"
>>> userTable="Users" validate="true"/>
>>> <Resource auth="Container" name="jdbc/sift" scope="Shareable"
>>> type="javax.sql.DataSource"/>
>>> </Context>
>>>
>>> Thank you.
>>>
>>> -Joleen
>>>
>>>
>>> On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <oldenuf2nobtr@gmail.com
>>> > wrote:
>>>
>>>> Thank you for some direction.
>>>>
>>>> I'll go ahead and put back the logging as it was from the vendor using
>>>> the logging.properties file, etc. etc. so as to minimize their lack of
>>>> support due to me changing a lot in their product.
>>>>
>>>> Then I'll go on to try option b.
>>>>
>>>> I'll report back with how it goes.
>>>>
>>>> -Joleeb
>>>> Joleen,
>>>>
>>>> On 11/24/15 4:31 PM, Joleen Barker wrote:
>>>> > I have setup the logrotate using cron in the past and it was very
>>>> > successful on the Linux boxes but I could not find an equivalent
>>>> setup for
>>>> > AIX. Things seem so much easier on Linux. The company wants a
>>>> universal
>>>> > approach so that left that option out.
>>>>
>>>> Only some things are easier on Linux.
>>>>
>>>> This may help:
>>>> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
>>>>
>>>> > I did see the section you copied in from the catalina.sh file but
>>>> couldnt
>>>> > make much out from it so I left it alone.
>>>> >
>>>> > I like the sound of option b. I know where the context xml file is.
>>>> (Under
>>>> > the Catalina/localhost/<context>.xml) Im not sure if this is what you
>>>> mean
>>>> > by descriptor.
>>>>
>>>> Yup, that's the one. Just add the swallowOutput setting and restart the
>>>> web application. (Or restart Tomcat if that's easier for you.)
>>>>
>>>> > If I did this would I leave the log4j config changes that I
>>>> > have in place that already?
>>>>
>>>> No, you wouldn't have to use log4j at all. JULI can do log-rotation as
>>>> well, though the options aren't as nice as log4j. Log4j is a really
>>>> great logging system, actually.
>>>>
>>>> -chris
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
I changed it back to use the log4j setting as I liked it better and the
boss wants the files to rollover at midnight each night. Now when I startup
the catalina.out file is empty and the logs appear to be split between the
catalina file (not catalina.out) and the localhost file. Some of the
messages are doubled between the two files.


We will see what happens now with the swallowOutput=true. I'm so excited to
see what is there tomorrow morning. lol

-Joleen

On Wed, Nov 25, 2015 at 6:59 PM, Joleen Barker <ol...@gmail.com>
wrote:

> Sorry. I all of a sudden noticed the swallowOutput="false" in the cfcc.xml
> I had. I changed this to be true and now it appears most of the messages
> are being written to the locahost file. I don't see any messages missing. I
> will leave it run over night and see what happens and report tomorrow.
>
> -Joleen
>
> On Wed, Nov 25, 2015 at 3:50 PM, Joleen Barker <ol...@gmail.com>
> wrote:
>
>> I didn't get too far. For the option b and setting the swallowOutput=true
>> in right place I need to get some clarification.
>>
>> I was looking up more information about the swallowOutput parm so I
>> understood more. In Christopher's comments he spoke about updating the
>> context xml. This is where I am confused. When I think of the word
>> "context" it has always referring to the vendors web page to log in with
>> and the context set is "cfcc". There is a file named cfcc.xml in the
>> <Install_directory>/server/conf/Catalina/localhost directory. Then there is
>> the actual context.xml file located in the <Install_directory>/server/conf
>> directory. I am not sure which one I would put the swallowOutput parm in.
>> Maybe it would be both.
>>
>> The only items in the context.xml file that are not commented out are the
>> following settings and it's a pretty small file:
>>
>> <Context>
>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>> ...
>> ...
>> <Manager pathname="" />
>> ...
>> ...
>> <Valve classname="org.apache.catalina.valves.CometConnectionManagerValve"
>> />
>> </Context>
>>
>> The cfcc.xml file that I have has the following:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> <Context cachingAllowed="true"
>> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>> className="org.apache.catalina.core.StandardContext" cookies="true"
>> crossContext="false" debug="0" displayName="Secure Internet File Transfer
>> Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
>> mapperClass="org.apache.catalina.core.StandardContextMapper" path="/cfcc"
>> privileged="false" reloadable="false" swallowOutput="false"
>> useHttpOnly="false" useNaming="true"
>> wrapperClass="org.apache.catalina.core.StandardWrapper">
>> <Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
>> <Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
>> <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
>> directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
>> suffix=".txt" timestamp="true" verbosity="2"/>
>> <Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
>> connectionName="cfcc" connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
>> connectionURL="jdbc:mysql://
>> 192.168.1.7:3306/mft730?characterEncoding=UTF8" debug="0" digest="SHA"
>> driverName="com.mysql.jdbc.Driver" roleNameCol="RoleID"
>> userCredCol="Passwd" userNameCol="UserID" userRoleTable="UsersMap"
>> userTable="Users" validate="true"/>
>> <Resource auth="Container" name="jdbc/sift" scope="Shareable"
>> type="javax.sql.DataSource"/>
>> </Context>
>>
>> Thank you.
>>
>> -Joleen
>>
>>
>> On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <ol...@gmail.com>
>> wrote:
>>
>>> Thank you for some direction.
>>>
>>> I'll go ahead and put back the logging as it was from the vendor using
>>> the logging.properties file, etc. etc. so as to minimize their lack of
>>> support due to me changing a lot in their product.
>>>
>>> Then I'll go on to try option b.
>>>
>>> I'll report back with how it goes.
>>>
>>> -Joleeb
>>> Joleen,
>>>
>>> On 11/24/15 4:31 PM, Joleen Barker wrote:
>>> > I have setup the logrotate using cron in the past and it was very
>>> > successful on the Linux boxes but I could not find an equivalent setup
>>> for
>>> > AIX. Things seem so much easier on Linux. The company wants a universal
>>> > approach so that left that option out.
>>>
>>> Only some things are easier on Linux.
>>>
>>> This may help:
>>> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
>>>
>>> > I did see the section you copied in from the catalina.sh file but
>>> couldnt
>>> > make much out from it so I left it alone.
>>> >
>>> > I like the sound of option b. I know where the context xml file is.
>>> (Under
>>> > the Catalina/localhost/<context>.xml) Im not sure if this is what you
>>> mean
>>> > by descriptor.
>>>
>>> Yup, that's the one. Just add the swallowOutput setting and restart the
>>> web application. (Or restart Tomcat if that's easier for you.)
>>>
>>> > If I did this would I leave the log4j config changes that I
>>> > have in place that already?
>>>
>>> No, you wouldn't have to use log4j at all. JULI can do log-rotation as
>>> well, though the options aren't as nice as log4j. Log4j is a really
>>> great logging system, actually.
>>>
>>> -chris
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
Sorry. I all of a sudden noticed the swallowOutput="false" in the cfcc.xml
I had. I changed this to be true and now it appears most of the messages
are being written to the locahost file. I don't see any messages missing. I
will leave it run over night and see what happens and report tomorrow.

-Joleen

On Wed, Nov 25, 2015 at 3:50 PM, Joleen Barker <ol...@gmail.com>
wrote:

> I didn't get too far. For the option b and setting the swallowOutput=true
> in right place I need to get some clarification.
>
> I was looking up more information about the swallowOutput parm so I
> understood more. In Christopher's comments he spoke about updating the
> context xml. This is where I am confused. When I think of the word
> "context" it has always referring to the vendors web page to log in with
> and the context set is "cfcc". There is a file named cfcc.xml in the
> <Install_directory>/server/conf/Catalina/localhost directory. Then there is
> the actual context.xml file located in the <Install_directory>/server/conf
> directory. I am not sure which one I would put the swallowOutput parm in.
> Maybe it would be both.
>
> The only items in the context.xml file that are not commented out are the
> following settings and it's a pretty small file:
>
> <Context>
> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> ...
> ...
> <Manager pathname="" />
> ...
> ...
> <Valve classname="org.apache.catalina.valves.CometConnectionManagerValve"
> />
> </Context>
>
> The cfcc.xml file that I have has the following:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <Context cachingAllowed="true"
> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
> className="org.apache.catalina.core.StandardContext" cookies="true"
> crossContext="false" debug="0" displayName="Secure Internet File Transfer
> Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
> mapperClass="org.apache.catalina.core.StandardContextMapper" path="/cfcc"
> privileged="false" reloadable="false" swallowOutput="false"
> useHttpOnly="false" useNaming="true"
> wrapperClass="org.apache.catalina.core.StandardWrapper">
> <Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
> <Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
> <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
> directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
> suffix=".txt" timestamp="true" verbosity="2"/>
> <Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
> connectionName="cfcc" connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
> connectionURL="jdbc:mysql://192.168.1.7:3306/mft730?characterEncoding=UTF8"
> debug="0" digest="SHA" driverName="com.mysql.jdbc.Driver"
> roleNameCol="RoleID" userCredCol="Passwd" userNameCol="UserID"
> userRoleTable="UsersMap" userTable="Users" validate="true"/>
> <Resource auth="Container" name="jdbc/sift" scope="Shareable"
> type="javax.sql.DataSource"/>
> </Context>
>
> Thank you.
>
> -Joleen
>
>
> On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <ol...@gmail.com>
> wrote:
>
>> Thank you for some direction.
>>
>> I'll go ahead and put back the logging as it was from the vendor using
>> the logging.properties file, etc. etc. so as to minimize their lack of
>> support due to me changing a lot in their product.
>>
>> Then I'll go on to try option b.
>>
>> I'll report back with how it goes.
>>
>> -Joleeb
>> Joleen,
>>
>> On 11/24/15 4:31 PM, Joleen Barker wrote:
>> > I have setup the logrotate using cron in the past and it was very
>> > successful on the Linux boxes but I could not find an equivalent setup
>> for
>> > AIX. Things seem so much easier on Linux. The company wants a universal
>> > approach so that left that option out.
>>
>> Only some things are easier on Linux.
>>
>> This may help:
>> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
>>
>> > I did see the section you copied in from the catalina.sh file but
>> couldnt
>> > make much out from it so I left it alone.
>> >
>> > I like the sound of option b. I know where the context xml file is.
>> (Under
>> > the Catalina/localhost/<context>.xml) Im not sure if this is what you
>> mean
>> > by descriptor.
>>
>> Yup, that's the one. Just add the swallowOutput setting and restart the
>> web application. (Or restart Tomcat if that's easier for you.)
>>
>> > If I did this would I leave the log4j config changes that I
>> > have in place that already?
>>
>> No, you wouldn't have to use log4j at all. JULI can do log-rotation as
>> well, though the options aren't as nice as log4j. Log4j is a really
>> great logging system, actually.
>>
>> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
I didn't get too far. For the option b and setting the swallowOutput=true
in right place I need to get some clarification.

I was looking up more information about the swallowOutput parm so I
understood more. In Christopher's comments he spoke about updating the
context xml. This is where I am confused. When I think of the word
"context" it has always referring to the vendors web page to log in with
and the context set is "cfcc". There is a file named cfcc.xml in the
<Install_directory>/server/conf/Catalina/localhost directory. Then there is
the actual context.xml file located in the <Install_directory>/server/conf
directory. I am not sure which one I would put the swallowOutput parm in.
Maybe it would be both.

The only items in the context.xml file that are not commented out are the
following settings and it's a pretty small file:

<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
...
...
<Manager pathname="" />
...
...
<Valve classname="org.apache.catalina.valves.CometConnectionManagerValve" />
</Context>

The cfcc.xml file that I have has the following:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper"
className="org.apache.catalina.core.StandardContext" cookies="true"
crossContext="false" debug="0" displayName="Secure Internet File Transfer
Web Services" docBase="/opt/mftcc730/server/webapps/cfcc"
mapperClass="org.apache.catalina.core.StandardContextMapper" path="/cfcc"
privileged="false" reloadable="false" swallowOutput="false"
useHttpOnly="false" useNaming="true"
wrapperClass="org.apache.catalina.core.StandardWrapper">
<Valve className="com.proginet.sift.tomcat.valve.LoginValve"/>
<Valve className="com.proginet.sift.tomcat.valve.CfccAuthenticator"/>
<Logger className="org.apache.catalina.logger.FileLogger" debug="0"
directory="/opt/mftcc730/server/logs" prefix="localhost_cfcc_"
suffix=".txt" timestamp="true" verbosity="2"/>
<Realm className="com.proginet.sift.tomcat.ssldap.JDBCRealm"
connectionName="cfcc" connectionPassword="TgPGKAy//0gDOq2Co5UnM2AE8pM="
connectionURL="jdbc:mysql://192.168.1.7:3306/mft730?characterEncoding=UTF8"
debug="0" digest="SHA" driverName="com.mysql.jdbc.Driver"
roleNameCol="RoleID" userCredCol="Passwd" userNameCol="UserID"
userRoleTable="UsersMap" userTable="Users" validate="true"/>
<Resource auth="Container" name="jdbc/sift" scope="Shareable"
type="javax.sql.DataSource"/>
</Context>

Thank you.

-Joleen


On Wed, Nov 25, 2015 at 10:16 AM, Joleen Barker <ol...@gmail.com>
wrote:

> Thank you for some direction.
>
> I'll go ahead and put back the logging as it was from the vendor using the
> logging.properties file, etc. etc. so as to minimize their lack of support
> due to me changing a lot in their product.
>
> Then I'll go on to try option b.
>
> I'll report back with how it goes.
>
> -Joleeb
> Joleen,
>
> On 11/24/15 4:31 PM, Joleen Barker wrote:
> > I have setup the logrotate using cron in the past and it was very
> > successful on the Linux boxes but I could not find an equivalent setup
> for
> > AIX. Things seem so much easier on Linux. The company wants a universal
> > approach so that left that option out.
>
> Only some things are easier on Linux.
>
> This may help:
> http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796
>
> > I did see the section you copied in from the catalina.sh file but couldnt
> > make much out from it so I left it alone.
> >
> > I like the sound of option b. I know where the context xml file is.
> (Under
> > the Catalina/localhost/<context>.xml) Im not sure if this is what you
> mean
> > by descriptor.
>
> Yup, that's the one. Just add the swallowOutput setting and restart the
> web application. (Or restart Tomcat if that's easier for you.)
>
> > If I did this would I leave the log4j config changes that I
> > have in place that already?
>
> No, you wouldn't have to use log4j at all. JULI can do log-rotation as
> well, though the options aren't as nice as log4j. Log4j is a really
> great logging system, actually.
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
Thank you for some direction.

I'll go ahead and put back the logging as it was from the vendor using the
logging.properties file, etc. etc. so as to minimize their lack of support
due to me changing a lot in their product.

Then I'll go on to try option b.

I'll report back with how it goes.

-Joleeb
Joleen,

On 11/24/15 4:31 PM, Joleen Barker wrote:
> I have setup the logrotate using cron in the past and it was very
> successful on the Linux boxes but I could not find an equivalent setup for
> AIX. Things seem so much easier on Linux. The company wants a universal
> approach so that left that option out.

Only some things are easier on Linux.

This may help:
http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796

> I did see the section you copied in from the catalina.sh file but couldnt
> make much out from it so I left it alone.
>
> I like the sound of option b. I know where the context xml file is. (Under
> the Catalina/localhost/<context>.xml) Im not sure if this is what you mean
> by descriptor.

Yup, that's the one. Just add the swallowOutput setting and restart the
web application. (Or restart Tomcat if that's easier for you.)

> If I did this would I leave the log4j config changes that I
> have in place that already?

No, you wouldn't have to use log4j at all. JULI can do log-rotation as
well, though the options aren't as nice as log4j. Log4j is a really
great logging system, actually.

-chris

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

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Joleen,

On 11/24/15 4:31 PM, Joleen Barker wrote:
> I have setup the logrotate using cron in the past and it was very
> successful on the Linux boxes but I could not find an equivalent setup for
> AIX. Things seem so much easier on Linux. The company wants a universal
> approach so that left that option out.

Only some things are easier on Linux.

This may help:
http://www-01.ibm.com/support/docview.wss?uid=isg3T1012796

> I did see the section you copied in from the catalina.sh file but couldnt
> make much out from it so I left it alone.
> 
> I like the sound of option b. I know where the context xml file is. (Under
> the Catalina/localhost/<context>.xml) Im not sure if this is what you mean
> by descriptor.

Yup, that's the one. Just add the swallowOutput setting and restart the
web application. (Or restart Tomcat if that's easier for you.)

> If I did this would I leave the log4j config changes that I
> have in place that already?

No, you wouldn't have to use log4j at all. JULI can do log-rotation as
well, though the options aren't as nice as log4j. Log4j is a really
great logging system, actually.

-chris

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


Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Joleen Barker <ol...@gmail.com>.
Thank you so much Christopher for all that information. I will look in to
the various options you've presented.

I have setup the logrotate using cron in the past and it was very
successful on the Linux boxes but I could not find an equivalent setup for
AIX. Things seem so much easier on Linux. The company wants a universal
approach so that left that option out.

I did see the section you copied in from the catalina.sh file but couldnt
make much out from it so I left it alone.

I like the sound of option b. I know where the context xml file is. (Under
the Catalina/localhost/<context>.xml) Im not sure if this is what you mean
by descriptor. If I did this would I leave the log4j config changes that I
have in place that already?

-Joleen
On Nov 20, 2015 9:37 AM, "Christopher Schultz" <ch...@christopherschultz.net>
wrote:

> Joleen,
>
> On 11/19/15 3:19 PM, Joleen Barker wrote:
> > I want to say up front that I am not a developer and know enough to brake
> > some stuff. lol
>
> Lots of "only admins" on this list. Welcome.
>
> > 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.
>
> Thanks for providing all that information up front.
>
> > 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.
>
> You did a great investigation and (nearly) all the steps you took were
> reasonable. Unfortunately, switching from JULI to Log4j isn't going to
> fix this problem, and neither of those packages will save you from the
> catalina.out non-rotation problem. (See below)
>
> > Also, no I cannot contact the vendor as they just tell me to hire a
> > professional. So I am the professional.
>
> Wow. I wouldn't pay them any more money for anything. :(
>
> > 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.
>
> The trick is that catalina.out isn't managed by any Java-based logger...
> catalina.out is where the JVM process's stdout/stderr streams have been
> redirected by the startup script -- almost certainly catalina.sh.
>
> If you read bin/catalina.sh, you'll find some lines that look like this:
>
>     eval "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER
> $JAVA_OPTS $CATALINA_OPTS \
>       -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath
> "\"$CLASSPATH\"" \
>       -Dcatalina.base="\"$CATALINA_BASE\"" \
>       -Dcatalina.home="\"$CATALINA_HOME\"" \
>       -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
>       org.apache.catalina.startup.Bootstrap "$@" start \
>       >> "$CATALINA_OUT" 2>&1 "&"
>
> (Those are in there a few times, FYI, depending on certain options.)
>
> The last line in there redirects everything to catalina.out. This makes
> it essentially non-rotatable.
>
> So, what to do?
>
> Well, have a look at this, which is rather terse:
> http://wiki.apache.org/tomcat/FAQ/Logging#Q10
>
> Basically, your options are:
>
> a) Stop logging so much to stdout/stderr (this is the *right* solution,
> but if the "vendor" isn't helpful, then there's not much you can do here).
>
> b) Modify the <context> element in your deployment descriptor to specify
> swallowOutput="true". This will redirect System.err and System.out of
> the application to a logger that *is* affected by the JULI/Log4j
> configuration. This is the easiest solution for an administrator.
>
> c) Use jsvc to launch Tomcat instead of the startup scripts. jsvc is
> capable of re-opening its logs in response to a SIGUSR1 signal similar
> to what Apache httpd does. You can use logrotate just as you would do
> with httpd except you need to use SIGUSR1 as the signal to send to jsvc
> in your "postrotate" scriptlet.
>
> d) Modify catalina.sh to pipe the output through chronolog, rotatelogs,
> etc. instead of redirecting to a file. Then, manage the rotation of the
> log file using whatever pipe-based logger you choose to use. This is
> fairly easy to do, but upgrading Tomcat means you have to remember to
> re-enable the piped-logger, because you'll get a fresh copy of
> catalina.sh with the new version of Tomcat.
>
> e) If you use the venerable logrotate, set it to rotate catalina.out
> with the "copytruncate" option. See the logrotate man page for details.
>
> I'll try to update the FAQ with some of this extra information.
>
> Hope that helps,
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat catalina.out log is not rolling using log4j DailyRollingFileAppender

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Joleen,

On 11/19/15 3:19 PM, Joleen Barker wrote:
> I want to say up front that I am not a developer and know enough to brake
> some stuff. lol

Lots of "only admins" on this list. Welcome.

> 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.

Thanks for providing all that information up front.

> 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.

You did a great investigation and (nearly) all the steps you took were
reasonable. Unfortunately, switching from JULI to Log4j isn't going to
fix this problem, and neither of those packages will save you from the
catalina.out non-rotation problem. (See below)

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

Wow. I wouldn't pay them any more money for anything. :(

> 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.

The trick is that catalina.out isn't managed by any Java-based logger...
catalina.out is where the JVM process's stdout/stderr streams have been
redirected by the startup script -- almost certainly catalina.sh.

If you read bin/catalina.sh, you'll find some lines that look like this:

    eval "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER
$JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath
"\"$CLASSPATH\"" \
      -Dcatalina.base="\"$CATALINA_BASE\"" \
      -Dcatalina.home="\"$CATALINA_HOME\"" \
      -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
      org.apache.catalina.startup.Bootstrap "$@" start \
      >> "$CATALINA_OUT" 2>&1 "&"

(Those are in there a few times, FYI, depending on certain options.)

The last line in there redirects everything to catalina.out. This makes
it essentially non-rotatable.

So, what to do?

Well, have a look at this, which is rather terse:
http://wiki.apache.org/tomcat/FAQ/Logging#Q10

Basically, your options are:

a) Stop logging so much to stdout/stderr (this is the *right* solution,
but if the "vendor" isn't helpful, then there's not much you can do here).

b) Modify the <context> element in your deployment descriptor to specify
swallowOutput="true". This will redirect System.err and System.out of
the application to a logger that *is* affected by the JULI/Log4j
configuration. This is the easiest solution for an administrator.

c) Use jsvc to launch Tomcat instead of the startup scripts. jsvc is
capable of re-opening its logs in response to a SIGUSR1 signal similar
to what Apache httpd does. You can use logrotate just as you would do
with httpd except you need to use SIGUSR1 as the signal to send to jsvc
in your "postrotate" scriptlet.

d) Modify catalina.sh to pipe the output through chronolog, rotatelogs,
etc. instead of redirecting to a file. Then, manage the rotation of the
log file using whatever pipe-based logger you choose to use. This is
fairly easy to do, but upgrading Tomcat means you have to remember to
re-enable the piped-logger, because you'll get a fresh copy of
catalina.sh with the new version of Tomcat.

e) If you use the venerable logrotate, set it to rotate catalina.out
with the "copytruncate" option. See the logrotate man page for details.

I'll try to update the FAQ with some of this extra information.

Hope that helps,
-chris

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