• 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

Cannot read Log4j2 package

 
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 expert,

I am a beginner in logging tool and decided to try out Log4j2.

In my build path, I have attached log4j-web-2.8.2.jar and log4j-to-slfj-2.8.2.jar.

And then I did the following configuration : // I tried out both type : Configuration status = "infor" and "warn"



Now, at my classes, I am supposed to put in the logger but when I write this line :

private static Logger log = Logger.getLogger( MyClass.class )

Eclipse IDE just won't call out the Log4j2 logger...it asked me to change to Log etc...Please see screenshot.

Hope someone can advise me where I have gone wrong.

Thanks.


 
tangara goh
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the answer.  The xml file has to be at the source folder.
 
reply
    Bookmark Topic Watch Topic
  • New Topic