File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Unable to control logging levels in Struts2 using log4j.properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to control logging levels in Struts2 using log4j.properties" Watch "Unable to control logging levels in Struts2 using log4j.properties" New topic
Author

Unable to control logging levels in Struts2 using log4j.properties

Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
Ok, here's my dilema,
I have an Struts2 application running on a GlassFish server. Everything runs just fine, but the problem that I have is configuring the logging levels using log4j. Every time I submit a request, my console gets a a ton of messages and the server.log file is getting rotated frequently because the logs get full rapidily. I've tried to decrease the log levels for some of the packages in struts 2 but nothing seems to work

Here's my log4j.properties


Does anyone know what I can do to stop all these messages from appearing in my logs. I just want error messages not bunch of debugs and info, warnings.
I've tried a lot of things but now I don't know what to do

Does the fact that I have both commons-logging.jar and lo4j.jar in my lib have anything to do with this? As far as I know Struts2 uses commons-logging but I would think that they can both work independently???
Please help

Here's a snippet from my console
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It might be a GlassFish-specific issue, since I'm controlling logging just fine on three different app servers using a log4j.properties file.

Perhaps it's picking up a server-wide config?
Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
Thanks David, I thought about that too but I'm not really sure I've messed around with GlassFish settings. I'll investigate even further and will post again once I find the solution
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to control logging levels in Struts2 using log4j.properties
 
Similar Threads
Where are tlds for struts 2.0.11 ?
Struts2 java.lang.reflect.InvocationTargetException (Struts2 with Hibernate)
Could not initialize class thats under WEB-INF
Error with Struts2
Exception in struts2 server startup