JBoss Community

writing own standalone module that needs legacy log4j support

created by John Mazzitelli in JBoss AS 7 Development - View the full discussion

This is yet another log4j thread - however, I think its different than most that have been posted - at least I can't find the answer to my specific use case - so don't roll your eyes just yet :)

 

I am not writing an EAR, WAR, whatever. I am writing a standalone module (it has a Main-Class in it - its just like what the org.jboss.as.cli module does) and I am deploying it as just a module. I start the server via something like "java -jar jboss-modules.jar -mp <module paths> org.my.module" (this is similar to how the jboss CLI script starts the CLI)

 

However, my module code is using some legacy libraries that use both commons-logging with log4j underneath (there is a log4j.xml that I want to be used to configure the logging).

 

I do NOT get any ClassNotFound or similar errors, the code runs "ok" - only, I do not see any of log messages coming out in the console or the file (I have both appenders defined in log4j.xml).

 

In my modules.xml, I do have a dependency on modules org.apache.commons.logging, org.apache.log4j, org.jboss.logmanager and org.jboss.logging. My module does NOT have any of those jars inside of it (that is, my module does not contain the log4j.jar or the commons-logging.jar - since I have a dependency declared for them, I did not put them in my module).

 

Does this make sense? Any ideas on how I get this to work?  Oh, and where exactly is log4j getting is configuration if not from my module's own logj4.xml?

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community