java


slf4j not working on Websphere but java.util.Logging does


I've setup a very simple log project which logs using both java.util.Logging and slf4j. The java.util.logging works fine but slf4j fails.
This is my setup:
log4j.properties:
# Root logger option
log4j.rootLogger=INFO, stdout, file
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/XXX/log4j.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
pom.xml snippet:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
Sample java code:
import java.util.logging.Logger;
public class LogBean {
Logger log = Logger.getLogger(this.getClass().getName());
org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass());
public void log() {
log.info("Pushing to queue");
logger.info("slf4j log");
}
}
This code works fine on JBoss EAP but not on Websphere. The log file does not get created.
Is there anything I'm missing?
Update - changing from log4j to JDK14 works implies the issue is with log4j?

Related Links

How to make JCheckBox from text file data
Changing course in Java properties
Java inheritance ArrayList type in method [duplicate]
For loop inside other for loop
Creating a monitor of messages between applications with Java
Convert JUnits to RESTful service
Best way to handle read timeouts in Spring Data MongoDB
Actionbar stretch out tabs
Java notifyAll() doesnt have a queue of itself
Cannot run GAE Test when gwt-dev dependency is removed (java.lang.NoClassDefFoundError: org/mortbay/xml/XmlParser)
Embedded jetty & jersey, works with Jersey 2.7, exception with 2.9
separate the JLabels and JTextFields into groups [duplicate]
Java program stops reading primes after 9930?
Run LibGDX game on ARM-based lubuntu linux?
Should I be converting to GregorianCalender and how in javascript?
Reading in files into two ArrayLists

Categories

HOME
netbeans
plone
office365api
rsyslog
programming-languages
spring-cloud-stream
ckeditor
echarts
ios-charts
flask-wtforms
workload-scheduler
pythonanywhere
excel-vba-mac
paging
tar
dcevm
pass-by-reference
firebase-crash-reporting
android-widget
javacv
fopen
objectanimator
bpel
sql-server-2012-express
bcd
data-manipulation
gammu
mpmediaquery
devextreme
espeak
vapor
ssjs
tasker
email-templates
android-tabhost
g-code
acoustics
jquery-validate
celery-task
typed-lambda-calculus
android-cursor
epson
minimization
bonobo
photobucket
citrus-pay
android-listview
ibaction
graph-api-explorer
geonetwork
ng-animate
dd
qpainter
relocation
funcunit
cloud-connect
monomac
intentservice
multiprocessor
ivyde
google-cloud-save
hungarian-algorithm
comaddin
interface-orientation
factory-method
itmstransporter
broken-links
first-responder
automount
errai
reddot
ohm
xdomainrequest
pyinotify
telerik-scheduler
fluent-interface
gallio
.nettiers
suppress
mirah
castle-monorail
database-management
firefox4
spec#
ubuntu-9.04

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App