This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

REG : Struts 2 logging

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I am developing a web application with Struts 2. I have been using log4j for logging. when i tried to use the same in struts 2 application. it doesn't seem to work. I am sure that i am doing something wrong with the way i give the configuration. Can someone tell me a link or site where i can learn it? i have searched in Struts 2 documentation as well. Here is my log4j.xml below. I am using the logger named "com.keerthi". the log file seems to be created but the debug statements are not getting written in sample.log file

Any suggestions or help is highly appreciated.
Thank you for your time,
Keerthi
 
Keerthivasan Ramanathan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Just wanted to post my work status.I have changed the log4j.xml a bit like setting all internal struts packages level to "OFF", since i got some loads of logs from these packages. Even now, the sample.logs is created but there is no logs for debug statements from com.keerthi package. it would be great, if someone can help me to resolve it. Thank you


 
Bartender
Posts: 9586
13
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The logger name does not have to be the package name, though the naming convention is that one uses the package name.
When you create a logger instance in your code, are you using the package name?
You can find the documentation for Log4j here.
 
Keerthivasan Ramanathan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Joe for the reply. I use package name for instantiating the loggers in each class.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!