This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

server.log file

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to create server.log file every time when i restart jboss server. Default it create only once when i start jboss server first time. i want to create separate server.log file every time when i restart jboss server old server.log file should be rename.

can anyone please help me to solve this issue ?

Prashant K
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the jboss-log4j.xml, there's a appender configuration named "FILE" for server.log. There's an "Append" attribute which you can set to false. This will result in the server.log file being created afresh whenever the server is restarted. However, it wont create a backup copy of the old file.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could also change the FILE appender to use RollingFileAppender class. This appender limits the log file to a certain size, at which point it closes and renames the log file, and opens a new log file.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
when adding appender and we omit MaxFileSize what will be the default size?
thanks
[ July 20, 2008: Message edited by: Steve Malone ]
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

when adding appender and we omit MaxFileSize what will be the default size?


There is no limit to the file size. It will keep increasing. However, if you are having a DailyRollingFileAppender, then the file will be rolled over every day at midnight, irrespective of the log file size.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the Log4J book I have (from 2005), the default file size for the rolling appender is 10MB. (I could have looked in the source code to see if that is still the default size, but you can do that as easily as I can.)

Personally, I never leave off such a property value. First, the default is usually not acceptable (10MB is a little small). Second, everyone who later on looks at the config file will ask the same question you did, including you because a year from now even you will not remember what it was.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic