This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

server.log doesn't save MaxBackupIndex= "5"

 
William Woodland
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server.log suddenly stopped creating 5 backups as I've indicated in the log4j.xml.
The service worked fine for several weeks then suddenly quit.

I've restarted the service this made no change. Currently it's saving one backup.
Below is a selection of my log4j.xml file. I could just reinstall the application but this is a production server
and I hoped someone might've experienced this and have another idea?

Many thanks,
Mark





--JBoss version 4.0.4
--JAVA 1.5
Running on Windows 2003 server SP2
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William (or is it Mark? I'm confused!), welcome to Java Ranch!

Currently it's saving one backup.

Let me see if I understand this correctly. You are saying that you have two server log files in server/xxx/log, one if server.log and the other something like server.log.001 (I can't recall the exact naming convention for the backup log file). In addition, the backup log file contains the immediately prior set of log entries; that is, prior to the first log entry in server.log. And server.log contains the most recent log entries.

Some things that I would check:

a) There is no batch job running that is automatically removing (or moving) older files.
b) The disk is not out of space.
c) There is no stray version of log4j somewhere. (Add "-verbose:class" to the JAVA_OPTS in the run script, look for the log4j classes being loaded and the jar it is coming from)
d) Double-check the permissions on the log directory, make sure the account running JBoss AS has sufficient permissions


By the way, it would help tremendously if you also told us:
1) which version of JBoss AS
2) which OS you are running on
3) which JVM you are running
 
William Woodland
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter,

Yes that's it exactly. I currently have two server.logs when a few days ago JBoss was creating 5 per the log4j file.

My first name is William, but I signoff with my middle name, hope that fixes any confusion. Thanks for the greeting!!


No batch file removing the older files.
Disk space looks good,
As do the permissions.
There are other log4j files in separate directories. ( we run mulitple server instances on this Windows 2003 SP2 box)
Shouldn't affect this instance though.

Thanks for your suggestions. I've noted the JBoss and JAVA versions in the first note.

One other thing. I did try changing the value from 5 to 1 again. Allowing some time for JBoss to see the change
and then changing it back hoping to 'jar' the system back to normal. Unsuccessful attempt.

Any other suggestions are welcomed!
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the size of the latest server.log file? Has it reached or exceeded 500 MB? And what's the size of the backup file that was created?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that JBoss AS re-reads the jboss-log4j.xml file periodically (once and hour?), but to really be sure you should restart it after changing that file.
 
William Woodland
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both replies.

I'm still checking on the size of the current server.log and backup file.

We start the JBoss service each Wed. morning at 02:00am and I made the change Tues night. I'd hoped
the reboot might get the service and log4j file back 'aligned'. That didn't happen.

I have asked that another log4j.xml file, (one I've created) be copied in place of
this old one. I'm awaiting the outcome of that.

Will update here when I know more. I've looked around on other Java and JBoss sites
this doesn't appear to be a common issue.
 
William Woodland
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I reinstalled the JBoss server yesterday and the server.log continues to only produce
1 file, (currently 135mb)


A snippet of my log4j:

<appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/server.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="500MB"/>
<param name="MaxBackupIndex" value="5"/>

<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p [%c] %m%n"/>
</layout>
</appender>

There isn't a batch file removing old files.

There are a few other running instances of JBoss on this server (other log4j files) but they're in different directories and
have never interfered with server.log since this malfunction started about a month ago.

I'm baffled.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Woodland wrote:I reinstalled the JBoss server yesterday and the server.log continues to only produce
1 file, (currently 135mb)

That is not surprising considering that the MaxFileSize is set to 500MB.
 
William Woodland
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
500mb is too large for a log file? It had worked for about a month with no issues.
 
Paul Clapham
Sheriff
Pie
Posts: 20184
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would expect the second log file to start being produced when the first log file exceeded 500MB. Is that not your understanding of that configuration file?
 
William Woodland
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's my expectation too. And it was working fine for a nearly a month then suddenly stopped.
The reason I'd set the figure so high was to capture a day's worth of webserver activity. At the default setting, 50mb, 2 backup files, only 10min activity was being captured. I recently checked the current 135mb file and we're now capturing 28hrs. of web server activity.

Thanks for all comments! I'd still like to figure out why the logging isn't following the log4j parameters but I can't spend
any more time on this especially since the business need is being met.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic