• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is there a way to change File log rotation by date,size,no of files using Mbeans in Jboss

 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do knw how to change the log level using


now i need to use FileAppender,RollingFileAppender,DailingRollingFileAppender, etc.

So, is there a configuration that allows me to change these configurations as well ?
 
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
Logging in JBoss AS is configured using the server/xxx/conf/jboss-log4j.xml file.

There is a MBean named jboss.system:service=Logging,type=Log4jService. It has various attributes and operations that you can use to change logging dynamically. In addition, if I remember correctly, JBoss AS will re-read the jboss-log4j.xml file periodically to catch any changes.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:Logging in JBoss AS is configured using the server/xxx/conf/jboss-log4j.xml file.

There is a MBean named jboss.system:service=Logging,type=Log4jService. It has various attributes and operations that you can use to change logging dynamically. In addition, if I remember correctly, JBoss AS will re-read the jboss-log4j.xml file periodically to catch any changes.



Yep, I also think the interval for checking the jboss-log4j.xml file is every 60 seconds. or is it every 5 minutes, it is one of those two. jboss-log4j.xml is the only configuration file in the server's conf directort that does not require a reboot.

Mark
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
going off topic......

here is wht i want :

change File log rotation by

date : File log should be generated once a month or once a day or once a minute
size : New file log should be generated after exceeding 10mb or 10 kb
no of files : max file index.

These are all allowed operations by FileAppender,RollingFileAppender,DailingRollingFileAppender

I want the Client to configure this VIA WEB CONSOLE.
eg: client can go online and say that the file max size should be 30MB.

(this is possible by using servlets/jsp/editing log4j.properties file, but my requirement is using webconsole)


By the way, I did find a way to do so: creating my own MBean and it worked too !! but the web console shows my custom method
setLoggerFilesize() with parameters "p1" "p2" and "p3" and description "(no description)", this is undesirable.
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found the custom approach simpler since it requires me to drop a sar file into the deploy folder rather than tweaking the server conf folder.
In the live environment, i may not have access to the conf folder
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic