Skip to main content



      Home
Home » Language IDEs » AspectJ » Demand base logging on production
Demand base logging on production [message #1073095] Wed, 24 July 2013 02:06 Go to next message
Eclipse UserFriend
Hi,


I am new to AOP. I am working on a legacy software developed in swing and core java. I wanted to add a logging feature in the system where

1. If something goes wrong in production system admin can enable logging without shutting down/restarting application.
2. Admin will redo the steps to create logs.
3.Once bug is reproduced admin can disable the logging and can upload logs to support site.

I am thinking of using AspectJ and I also wanted to collect logs only for a particular section of application.

Any help tutorials is highly appreciated.

Regards,
-Deepak
Re: Demand base logging on production [message #1073365 is a reply to message #1073095] Wed, 24 July 2013 11:42 Go to previous messageGo to next message
Eclipse UserFriend
Adding a logging aspect to your system is relatively simple, but AspectJ requires weaving either at load time or at compile time. This means that you cannot just add an aspect to a system that is already up and running.

What you need to do is add your aspects to the system, weave, and redeploy. Make sure that the logging is disabled until an admin comes around to enable them. All you would need to do is create an aspect like this:

aspect AdminLogging {
  pointcut whenToLog() : ...; // describe the joinpoints you want to log here

  before(Object obj) : whenToLog() && target(obj) {  // target will bind obj to the object that owns the joinpoint you are advising
    if (isAdminLoggedIn() {
      log(obj);
    }
  }
}


Re: Demand base logging on production [message #1073763 is a reply to message #1073365] Thu, 25 July 2013 08:58 Go to previous message
Eclipse UserFriend
Hello,

Thank you for providing this aspect.

Thanks
Previous Topic:debugging a embedded device using TCF
Next Topic:aspectj : how to compile only required files using
Goto Forum:
  


Current Time: Thu May 22 07:27:37 EDT 2025

Powered by FUDForum. Page generated in 0.07210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top