application logging does not output when packaging both commons-logging and log4j in EAP 6

Solution Unverified - Updated -

Issue

I packaged both commons-logging and log4j libraries and the following logging configuration into my application. But application logging did not output.

  • log4j.properties:
log4j.rootCategory=INFO,consoleLog,fileLog

log4j.appender.consoleLog=org.apache.log4j.ConsoleAppender
log4j.appender.consoleLog.Target = System.out
log4j.appender.consoleLog.layout = org.apache.log4j.PatternLayout
log4j.appender.consoleLog.layout.ConversionPattern=[%d{yyyy/MM/dd HH:mm:ss}][%p][%c{1}] %m%n

log4j.appender.fileLog=org.apache.log4j.FileAppender
log4j.appender.fileLog.File = /path/to/logfile
log4j.appender.fileLog.layout = org.apache.log4j.PatternLayout
log4j.appender.fileLog.layout.ConversionPattern=[%d{yyyy/MM/dd HH:mm:ss}][%p][%c{1}] %m%n
  • commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger      

Environment

  • JBoss Enterprise Application Platform (EAP) 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content