• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 821
  • 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: 40747
827
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: 13269
292
  • 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:

 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic