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

Logging with Java Commons Logging through AOP write logs to a file

 
sandeeprajsingh tandon
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, We have a spring application running on glassfish server, currently being developed on Windows ultimately to be deployed on a Unix box.
I have a Simple Aspect class for logging that uses Commons logging to calculate the time needed for each method to execute.
Now,
I want to configure the app inorder to redirect the logs generated by commons logging on to a seperate log file.

Kindly let me know the steps.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to configure the app inorder to redirect the logs generated by commons logging on to a seperate log file.


I would use SL4J which is an abstraction on top of your logging framework. This way your options as far as logging is concerned are more flexible. Then I would use Logback as your logging implementation and configure what and where you want things logged.
 
sandeeprajsingh tandon
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply,
I ulimtatly used Log4j
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic