Hallo David,



25 Oct 2013 13:42

I think here is where you get confused. The "original (empty) file" is not the original file. It is a new file that happens to have the same name as the the one that was renamed. The true original file is the one that was renamed and tomcat continues to use it completely unaware of your rename.
thx, I got that now.

Configuring your apps to use a true logging system and configuring the log system to rotate is the best option. Barring that, it get's tricky. You might be able to get away with copying the log file to another and then truncating the original but I think that only really works on *nix based systems. Windows if memory serves will pad the truncated file with empty space and append right were it left off.
I'm on linux and I would test the moving renamed file to a new folder. How comes Tomcat does not have a layer for logrotate for this?!

There has been discussion on the list in the past about this if your interested in doing some searching.
Ok, I'll make a search.

--David

Thx,
Michael

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

25 Oct 2013 11:54
2013/10/25 Web2 Solutions <m...@web2-solutions.com>:
Hallo All,

I've installed tomcat 7.0.42 and due heavy use my catalina.out and
localhost_access-jjj-mm-dd.txt grows quit big.

I've successfully configured logrotate to rotate both files. I've removed
the date from the access log.
So Tomcat now writes without rotating into localhost_access.txt

Logrotate now create a new file (localhost_access-dd-mm-dd.txt) and makes
localhost_access.txt empty.
But tomcat now writes into the new localhost_access-dd-mm-dd.txt instead of
the configured file (localhost_access.txt).
FYI:
You can configure the filename pattern so that it rotates more frequently,
e.g. every hour or every ten minutes.

What do I have todo so that tomcat continues to write into
localhost_access.txt  even after rotating?
Renaming the file is futile, because Tomcat (for access logs) or the
shell (for catalina.out)
has the file open and continues to write to it, regardless of the file name.

You can use copytruncate option of logrotate.

FYI: catalina.out is not a proper log file, but a redirection of
stdout (as managed in catalina.sh script that launches Tomcat java
process). If a system is configured properly, this file is usually
empty.

Best regards,
Konstantin Kolinko

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

25 Oct 2013 00:33
Hallo All,

I've installed tomcat 7.0.42 and due heavy use my catalina.out and localhost_access-jjj-mm-dd.txt grows quit big.

I've successfully configured logrotate to rotate both files. I've removed the date from the access log.
So Tomcat now writes without rotating into localhost_access.txt

Logrotate now create a new file (localhost_access-dd-mm-dd.txt) and makes localhost_access.txt empty.
But tomcat now writes into the new localhost_access-dd-mm-dd.txt instead of the configured file (localhost_access.txt).

What do I have todo so that tomcat continues to write into localhost_access.txt  even after rotating?

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

Reply via email to