Meaningless Drivel is fun!*
The moose likes Struts and the fly likes REG : Struts 2 logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "REG : Struts 2 logging" Watch "REG : Struts 2 logging" New topic
Author

REG : Struts 2 logging

Keerthivasan Ramanathan
Greenhorn

Joined: Mar 23, 2011
Posts: 11
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

Joined: Mar 23, 2011
Posts: 11
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


Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Keerthivasan Ramanathan
Greenhorn

Joined: Mar 23, 2011
Posts: 11
Thank you, Joe for the reply. I use package name for instantiating the loggers in each class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: REG : Struts 2 logging
 
Similar Threads
Odd validation error in log4j.xml
WARN level is not working
Log4j : specific class to log on FileAppender other classes log on Console Appender.
how to disable the log
Unable to log to file