• 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 ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Cannot read Log4j2 package  RSS feed

 
Ranch Hand
Posts: 496
  • Mark post as helpful
  • send pies
  • 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: 496
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the answer.  The xml file has to be at the source folder.
 
Villains always have antidotes. They're funny that way. Here's an antidote disquised as a tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!