It's not a secret anymore!
The moose likes Aspect Oriented Programming and the fly likes Logging with Java Commons Logging through AOP write logs to a file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Reply Bookmark "Logging with Java Commons Logging through AOP write logs to a file" Watch "Logging with Java Commons Logging through AOP write logs to a file" New topic
Author

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

sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 66
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

Joined: Mar 07, 2010
Posts: 1282

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.


[How To Ask Questions][Read before you PM me]
sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 66
Thanks for the reply,
I ulimtatly used Log4j
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Logging with Java Commons Logging through AOP write logs to a file
 
Similar Threads
Problem reg. Delete Operation in my struts application
loggin setup in Jboss
Jakarta Commons Logging
How do I customize JDK logging?
Logging into multiple files.