Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to control logging levels in Struts2 using log4j.properties

 
Roberto Hernandez
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic