[
https://jira.jboss.org/jira/browse/JBAS-6361?page=com.atlassian.jira.plug...
]
Dimitris Andreadis closed JBAS-6361.
------------------------------------
Fix Version/s: JBossAS-5.1.0.Beta1
JBossAS-6.0.0.Alpha1
Resolution: Done
Ok, set append to 'true' by default - do not truncate the server log upon
restart.
log write to server.log does not append to the file as expected
---------------------------------------------------------------
Key: JBAS-6361
URL:
https://jira.jboss.org/jira/browse/JBAS-6361
Project: JBoss Application Server
Issue Type: Task
Security Level: Public(Everyone can see)
Affects Versions: JBossAS-5.0.0.GA
Environment: Linux 2.6 intel, java 1.6
Reporter: Calin Medianu
Assignee: Dimitris Andreadis
Fix For: JBossAS-5.1.0.Beta1, JBossAS-6.0.0.Alpha1
When I truncate the server.log file (in my case jboss/server/default/log/server.log) the
server continues to write at the old offset. This is most likely because the file is not
open in append mode.
The expected behaviour in unix is that when a file is truncated, using the command:
> server.log
for instance, the file size is reduced to zero. What happens with jboss is that a file
with a hole is created:
[jboss@tm03 ~]$ ls -l jboss/server/default/log/server.log
-rw-rw-r-- 1 jboss jboss 1840433 Jan 5 01:08 jboss/server/default/log/server.log
# I truncate the file
[jboss@tm03 ~]$ > jboss/server/default/log/server.log
[jboss@tm03 ~]$ ls -l jboss/server/default/log/server.log
-rw-rw-r-- 1 jboss jboss 0 Jan 5 01:09 jboss/server/default/log/server.log
# the file is size 0 as expected
[jboss@tm03 ~]$ ls -l jboss/server/default/log/server.log
-rw-rw-r-- 1 jboss jboss 1841656 Jan 5 01:10 jboss/server/default/log/server.log
[jboss@tm03 ~]$ ls -s jboss/server/default/log/server.log
12 jboss/server/default/log/server.log
# The file has jumped to the reported size of 1841656 but actual size of 12 when the
logwriter wrote 12 bytes, but at the old offset of 1840433
This makes it impossible to truncate logs while the server is running.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira