I am trying to deploy on a WildFly OpenShift Cartridge a legacy webapp that uses commons logging with log4j to display log messages. I've search the whole internet and Stackoverflow, but all the answers I've got so far it doesn't works! Things I've tried so far:
- Exclude all log api and use logging from WildFly
- Jboss Logging
- JDK Logging
- System out logging
- bla bla bla logging
- Use attributes use-deployment-logging-config and add-logging-api-dependencies and start jboss with
nohup /var/lib/openshift/540544b2500446d0e6000065/wildfly/bin/standalone.sh -b $OPENSHIFT_WILDFLY_IP -bmanagement=$OPENSHIFT_WILDFLY_IP -Duse-deployment-logging-config=true -Dadd-logging-api-dependencies=false > /dev/null &
Only WildFly is capable to log on console! Nothing else!
I don't know if it's something peculiar to OpenShift WildFly cartridge or to WildFly itself. If anyone knows how to log using commons-log (by using
private static final Log LOG = LogFactory.getLog(MyClass.class);
), please report!
This is my log4j.properties
log4j.rootLogger=INFO, LOG
log4j.appender.LOG=org.apache.log4j.ConsoleAppender
log4j.appender.LOG.layout=org.apache.log4j.PatternLayout
log4j.appender.LOG.layout.ConversionPattern=%d %p %c - %m%n