JBOSS6,JBOSS7 only keeps a certain amount of log diaries.

Source: Internet
Author: User
Tags jboss

JBOSS7 settings

Enter the Standalone.xml in Standalone\configuration

Locate the original node below
<periodic-rotating-file-handler name= "File" autoflush= "true" >
<encoding value= "UTF-8"/>
<formatter>
<pattern-formatter pattern= "%d{hh:mm:ss,sss}%-5p [%c] (%t)%s%e%n"/>
</formatter>
<file relative-to= "Jboss.server.log.dir" path= "Server.log"/>
<suffix value= ". Yyyy-mm-dd"/>
<append value= "true"/>
</periodic-rotating-file-handler>

This is a file by date to output the journal file, one per day.

Comment out and use the following configuration

<size-rotating-file-handler name= "File" >
<formatter>
<pattern-formatter pattern= "%d{hh:mm:ss,sss}%-5p [%c] (%t)%s%e%n"/>
</formatter>
<file relative-to= "Jboss.server.log.dir" path= "Server.log"/>
<rotate-size value= "20m"/>
<max-backup-index value= "/>"
<append value= "true"/>
</size-rotating-file-handler>

Note: Keep 20 files, each file is 20MB.

The file name is: Server.log.1 ..... server.log.20

There's also a server.log that indicates the current input journal


JBOSS6 settings

Set the JBOSS6 log journaling profile, such as: D:\software\jboss-6.0.0.Final\server\default\deploy\jboss-logging.xml

As with JBOSS7, comment out the Periodic-rotating-file-handler node first

Add the following configuration, meaning that the log diary has a total of 20 files, each 20M.

<!--A size based file rolling appender--

<size-rotating-file-handler
File-name= "${jboss.server.log.dir}/server.log"
Name= "FILE"
Autoflush= "true"
Append= "true"
Rotate-size= "20m"
Max-backup-index= ">"

<error-manager>
<only-once/>
</error-manager>

<formatter>
<pattern-formatter pattern= "%d%-5p [%c] (%t)%m%n"/>
</formatter>
</size-rotating-file-handler>

JBOSS6,JBOSS7 only keeps a certain amount of log diaries.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.