Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Please help me understand what should be included in maven for logging ?

Ranch Hand
Posts: 608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,

I have problem in getting the right dependencies in order to use SLF4j with Log4j2.

Based on this URL :

it seems I only need log4j-api and slf4j-api in my pom.xml and in the classpath.  Pleas correct me if I am wrong.

I am now getting error from Tomcat :

Right now, I have these :


author & internet detective
Posts: 40035
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those are just the API (ex: interfaces.) You also need the implementation jar. That's log4j.

It looks like the list you are looking at is the dependencies of log4j rather than log4j itself.
Saloon Keeper
Posts: 12165
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This particular problem is caused by the scope of the log4j-api dependency having been set to provided. It's not provided by any application containers that I know of.

I don't understand why you have so many compile time dependencies on libraries that you only need on the class path at runtime. Try if this works:

It's feeding time! Give me the food you were going to give to this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic