This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging Error with Spring+Log4j

 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Log4j as my logger with Spring. I did everything as per the basic tutorial and tried to write log messages in a log file. But every attempt to this is failed

my web.xml file is


The log4j.properties file is



Then in my controller i wrote a code to add message to text file

No matter what, it's not working. but when i try to print it in console, its printing. Please help me where i went wrong?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you put log4j.properties ? Under WEB-INF ?
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:Where did you put log4j.properties ? Under WEB-INF ?


Yes it is under WEB-INF folder. As i said earlier there is no problem in detecting the prop file. Because the log messages got printed in console but when i try to write them to a file, it isn't writing. The log.txt file is also under WEB-INF.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajkumar balakrishnan wrote:As i said earlier there is no problem in detecting the prop file. Because the log messages got printed in console


Which message? The one printed with System.out.println()?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is ${Erp} ? Where does it come from ?
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lorand Komaromi wrote:
Which message? The one printed with System.out.println()?


Nope, logger.info(); Do you think i am that much dumb?

Christophe Verré wrote:What is ${Erp} ? Where does it come from ?


From web.xml. Have a look at this.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic