[jboss-jira] [JBoss JIRA] Updated: (JBAS-6361) log write to server.log does not append to the file as expected
Dimitris Andreadis (JIRA)
jira-events at lists.jboss.org
Tue Jan 20 12:57:04 EST 2009
[ https://jira.jboss.org/jira/browse/JBAS-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dimitris Andreadis updated JBAS-6361:
-------------------------------------
Issue Type: Task (was: Bug)
JBoss Forum Reference: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203357#4203357
This is not a bug. Check out the forum thread.
Also
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/FileAppender.html#setAppend(boolean)
> 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
>
> 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 at 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 at tm03 ~]$ > jboss/server/default/log/server.log
> [jboss at 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 at 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 at 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
More information about the jboss-jira
mailing list