• 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

JBoss and log4j (I want a separate log4j configuration for my application)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application running on JBoss and have decided to use log4j. I'm trying to set it up in such a way that I can maintain/control my own log4j setup/configuration in each application I create, separate from the JBoss log4j configuration. (I'd rather not have to update one big log4j.xml with each application I write. I'd rather control it in each application, if I choose to). I've found various things online, none of which I've been able to get working. The latest thing I've tried is a Log4jRepositorySelector a la http://www.jboss.org/community/wiki/Log4jRepositorySelector .

I'm not getting any errors when my code runs, but I'm also not getting any log4j comments written to a separate application log (or anywhere, not even the server.log).

Any help getting this working, pointers on where I'm going wrong, or advice are welcome. Thanks!

This is the AppRepositorySelector class:



And the AppContextListener:



My web.xml has this in it beneath the display-name and description, but prior to my security-constraint (web.xml is in my WEB-INF folder):


This is my log4j.xml (also in the WEB-INF folder):



And finally, this is my 'controller' that attempts to use log4j:



Sorry this is so long but I wanted to get all my info in. Any ideas? Thanks!
 
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
See if this helps http://www.jboss.org/index.html?module=bb&op=viewtopic&t=128979#4125416
 
Happily living in the valley of the dried frogs with a few tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic