You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michelle Warner <wa...@comcast.net> on 2014/12/30 02:55:13 UTC

Tomcat log dropping entries after log rotation

I am using Tomcat 8 with log4j2 to handle application logging. The log4j2.xml and log4j-api-2.0-rc2/jar are both located in the lib folder of Tomcat. After a log rotation, any ERROR log messages or messages associated with a hot deployment stop logging. If I bounce Tomcat, then the logging of those messages is restored.

Any ideas as to what could be causing this? I have not been able to find anything in my searches.

Thanks

Michelle

Re: Tomcat log dropping entries after log rotation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Michelle,

On 1/3/15 8:15 PM, Michelle Warner wrote:
> 
> ----- Original Message ----- From: "Christopher Schultz" 
> <ch...@christopherschultz.net> To: "Tomcat Users List"
> <us...@tomcat.apache.org> Sent: Tuesday, December 30, 2014 9:41 AM 
> Subject: Re: Tomcat log dropping entries after log rotation
> 
> 
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> Michelle,
>> 
>> On 12/29/14 8:55 PM, Michelle Warner wrote:
>>> I am using Tomcat 8 with log4j2 to handle application logging.
>>> The log4j2.xml and log4j-api-2.0-rc2/jar are both located in
>>> the lib folder of Tomcat. After a log rotation, any ERROR log
>>> messages or messages associated with a hot deployment stop
>>> logging. If I bounce Tomcat, then the logging of those messages
>>> is restored.
>>> 
>>> Any ideas as to what could be causing this? I have not been
>>> able to find anything in my searches.
>> 
>> How are you performing log rotation?
>> 
>> - -chris
> 
> I was using the time policy in the log4j2 property file.  Had it
> set for one day.  But I think I may have found the problem.  We
> moved to using a single log file as it helped with trouble shooting
> because of the number of applications and services we have.  That
> was our setup in JBoss and now that we are moving to Tomcat we
> wanted the same.  So while log4j2 was rotating the log seemingly
> fine,  it appears perhaps the  problem was with Tomcat still using
> juli internally.
> 
> When I set our applications to log to a file other than
> catalina.out then that file rotated fine and there was no loss of
> logging after log rotation. So, while the internals of Tomcat are
> still logging to catalina.out we are able to log our application
> specific stuff and rotate it now without losing logging.  Not sure
> how to fix the catalina.out rotation problem with log4j2 other than
> to make our applications use juli or perhaps some other
> implementation.

You can configure Tomcat to use log4j instead of JULI:
http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j

Rotation options for catalina.out:
http://wiki.apache.org/tomcat/FAQ/Logging#Q10

Note that rotating catalina.out should be entirely unnecessary.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUqwTcAAoJEBzwKT+lPKRYbw8P/1a6PQrJ+Xz4hXVbjmWi1QgY
QYTtJNn8Ww9Id22ZSbV/DzppZjU2Ej2DUqC4XfRZGiXlwR61jywrMPFAlyVNHFjq
RgMdDHJz5x2WB2a7wWSsX4w+2GV/hGG6L0x+dJmRJ+5/LADRoJc/Myw/8LlbuPPy
ZhsKe9jSwoQhwoDjTMuU0m3hdQmkfh6JHrXodv3VblI5CdamD/G3d0+VjrlY9sWD
0UGqD8tsVvBhlSokijPUjRwFEQutyIc0GXIk3aCwNFED86fOFEUewqATExBLohje
Gi9jpNIrnQwUgmMcDcjorWSLAKAKQ0BbWx7GOmeL0RlifRQNYD3XFGrQ/Waa2wrc
EI20rldOMxQeM9Bx6bVLw57/LDF7D+NuAtxACBw/c/0RpPePHR1B049nt8M4yaE5
OfdLPi3/dQ/bPQu3YOEtElbVNyQRjaKloK2DjBUvK97OkiMINfgR3TP1vz8pqQuy
F81qQ24CV0Av64FZRNeMByGhPYKjs5CiRjM+jq6jdvrfdgR7LnVX0rvBeioB4C2S
qOE/bfCO/BJ3PwLteW/OJ5KAG+246rz+jn7GGL+eTXLxsQnZ/OAVz6ZCSAb4ZcUZ
GNATmAgKL/Oab4Wh7krdeKiD1MIu9LHlYj81RvHUGFsW209QaUU08Yghuo5MLLPV
hjKWpWJhwb7qde2eltoE
=tKPQ
-----END PGP SIGNATURE-----

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


Re: Tomcat log dropping entries after log rotation

Posted by Michelle Warner <wa...@comcast.net>.
----- Original Message ----- 
From: "Christopher Schultz" <ch...@christopherschultz.net>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, December 30, 2014 9:41 AM
Subject: Re: Tomcat log dropping entries after log rotation


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Michelle,
>
> On 12/29/14 8:55 PM, Michelle Warner wrote:
>> I am using Tomcat 8 with log4j2 to handle application logging. The
>> log4j2.xml and log4j-api-2.0-rc2/jar are both located in the lib
>> folder of Tomcat. After a log rotation, any ERROR log messages or
>> messages associated with a hot deployment stop logging. If I
>> bounce Tomcat, then the logging of those messages is restored.
>>
>> Any ideas as to what could be causing this? I have not been able
>> to find anything in my searches.
>
> How are you performing log rotation?
>
> - -chris

I was using the time policy in the log4j2 property file.  Had it set for one 
day.  But I think I may have found the problem.  We moved to using a single 
log file as it helped with trouble shooting because of the number of 
applications and services we have.  That was our setup in JBoss and now that 
we are moving to Tomcat we wanted the same.  So while log4j2 was rotating 
the log seemingly fine,  it appears perhaps the  problem was with Tomcat 
still using juli internally.

When I set our applications to log to a file other than catalina.out then 
that file rotated fine and there was no loss of logging after log rotation. 
So, while the internals of Tomcat are still logging to catalina.out we are 
able to log our application specific stuff and rotate it now without losing 
logging.  Not sure how to fix the catalina.out rotation problem with log4j2 
other than to make our applications use juli or perhaps some other 
implementation.

Michelle 


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


Re: Tomcat log dropping entries after log rotation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Michelle,

On 12/29/14 8:55 PM, Michelle Warner wrote:
> I am using Tomcat 8 with log4j2 to handle application logging. The 
> log4j2.xml and log4j-api-2.0-rc2/jar are both located in the lib 
> folder of Tomcat. After a log rotation, any ERROR log messages or 
> messages associated with a hot deployment stop logging. If I
> bounce Tomcat, then the logging of those messages is restored.
> 
> Any ideas as to what could be causing this? I have not been able
> to find anything in my searches.

How are you performing log rotation?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUorm0AAoJEBzwKT+lPKRYckwP/332YPadkEHXw6OmDhbr7ADR
TbFVlsSnnmV49IZA667McqMnhUI1etDuvFo5uzDHr/AIme0bgQTAEYbGaTS/t9Bo
fQUVPU7/n4L6vNUZy/gYBwqkRH4lc6OlCPFMaJhMwetTWAbiqKrKnKUGJ2QNqpQH
O0lVAH9FNQ5RWq6orQCW5S3z65GrnojsI8JwxhfZ3FGlMRRHAUbQBgcm+C9rZ951
aPprxdeHlHg8kTQDJnmsj9ESBfNGyH8ktHl33Zo0ySO0LRJu/trnm08jca+kjxXm
HBFBpTF02cjHKdA+RmPNcyNRgGG/MHWxnYAIofpBjX+Qq48dmURhKRvRatbCoY7Z
bv27PrZzGpvbfN5pwlmYxkwXWYStxWnva1zCpIKQkefIxyaDoj8+OVynffnhIFSS
qtOdACs2vJIV00uGFVqTDtQDL9q8rM6WYBDk4MAFHlYswuCMb1uLISQvG8ZO3IX5
1vNafNvf7cz0jEtDIQje1Jlf4vSp3ONcLkNHU/fgbmKSoYsRsYlXe9DKmMgtVQG4
2ZmpUSu9B61q8TtHKn2k8KtGE8RBt8uyEDM48L1yd63vIW5GcEUgmuDTToXHOoyX
W/IvcZITm7Klcqd5ibh3ekOHHpXhO//c7Lz2RED3JVrKLsP4/lkfkRLBOay1GVol
NEkoe/IK3qqwd938gfpe
=luKw
-----END PGP SIGNATURE-----

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