Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Demand base logging on production
Demand base logging on production [message #1073095] Wed, 24 July 2013 06:06 Go to next message
Deepak Mising name is currently offline Deepak Mising nameFriend
Messages: 1
Registered: July 2013
Junior Member

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.

Re: Demand base logging on production [message #1073365 is a reply to message #1073095] Wed, 24 July 2013 15:42 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
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() {

Re: Demand base logging on production [message #1073763 is a reply to message #1073365] Thu, 25 July 2013 12:58 Go to previous message
Jessica Pinto is currently offline Jessica PintoFriend
Messages: 22
Registered: March 2013
Junior Member

Thank you for providing this aspect.

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

Current Time: Sat Feb 29 10:43:37 GMT 2020

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

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

Back to the top