Win a copy of Svelte and Sapper in Action this week in the 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

log4j propery configuration problem

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am using Log4j for my applications logging. I need assitance for two of my problems.

1. I keep getting the following errors on the console


My log4j.properties file is located in the default source package and here is the code.


And is here is the code of my class using it

All my logging is working fine but I dont know why I am still getting these messages.


2. Secondly, this messages keeps printing on the console like 100 times in a single request

I tried to stop that logging by setting the level of my root logger to WARN and created my own logger 'com' for debug logging and set it at the top of the level heiarchy. But I am unable to stop it. Is there any other way to avoid this message from printing because its hard to find the log mesages I printed from my code.

Thanks in advance for your time.



 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr. Chan,

I think you need to specify absolute path for you log4j.properties file. It should be something like this:

PropertyConfigurator.configure("C:\\WORKSPACE\\PROJECT\\web\\WEB-INF\\log4j.properties");

I hope this works

regards,
kishore
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is your log4j file added in the classpath?
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey.... For which version of Struts you are using?

The below info is for Struts 2
1) I had placed my log4j.properties file in src folder.
2) In web.xml include this code
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic