?
Solved

JBoss Server Log File Rotation

Posted on 2013-01-04
4
Medium Priority
?
1,131 Views
Last Modified: 2013-11-16
Hi,

Currently, JBoss log4j configuration comes with two existing log rolling appender sections:

 
RollingFileAppender – Rotate server.log files based on specified file size criteria DailyRollingFileAppender – Rotate server.log file based on specified time/date (daily by default)
 
However, I am looking for configuration which can rotate the log files based on file size and append the date/time stamp to the backup file created.
I have the following configuration in log4j XML file - log files are successfully getting rolled over based on size and maximum index criteria, but the backup files are not time/date stamped, instead they are created as ‘sever.log.1, server.log.2  etc…’.
 
<!-- A size based file rolling appender -->
   <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="3000KB"/>
     <param name="MaxBackupIndex" value="3"/>
 
     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
     </layout>           

   </appender>

Open in new window


I am looking for appender configuration that will roll log files based on file size, but also append the time/date stamp to it.

Appreciate your inputs.

Regards,
Aravind G
0
Comment
Question by:aravindgopaluni
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 38749340
did you try adding:

<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
0
 

Author Comment

by:aravindgopaluni
ID: 38772135
Hi,

Thanks for your inputs, I will verify and confirm

Regards,
Aravind G
0
 

Accepted Solution

by:
aravindgopaluni earned 0 total points
ID: 39639356
Hi,

I have verified the configuration and it seems with date appender the backup files are created as 'serverlog.1' etc...
0
 

Author Closing Comment

by:aravindgopaluni
ID: 39653025
I have verified the configuration and it seems with date appender the backup files are created as 'serverlog.1' etc...
0

Featured Post

ATEN's HDBaseT Presentation at InfoComm 2017

Hear ATEN Product Manager YT Liang review HDBaseT technology, highlighting ATEN’s latest solutions as they relate to real-world applications during her presentation at the HDBaseT booth at InfoComm 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question