• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :



Thanks!

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 15510
363
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic