cancel
Showing results for 
Search instead for 
Did you mean: 

How to log users' operations

leon
Champ in-the-making
Champ in-the-making
Firstly , I review an example org.alfresco.sample.loggerAction.LoggerActionExecuter, but after adding them to alfresco, it turns:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logger-action' defined in file [C:\tomcat\webapps\cms\WEB-INF\classes\alfresco\extension\logger-action-context.xml]: Initialization of bean failed; nested exception is java.lang.AbstractMethodError: null
java.lang.AbstractMethodError
   at org.alfresco.repo.action.ParameterizedItemAbstractBase.getParameterDefintions(ParameterizedItemAbstractBase.java:76)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.getActionDefinition(ActionExecuterAbstractBase.java:77)
   at org.alfresco.repo.action.ActionServiceImpl.registerActionExecuter(ActionServiceImpl.java:497)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.init(ActionExecuterAbstractBase.java:49)

I want to log the msg ,including the user login time, content he adds or deletes…., into database.
Is there some has done this? would you tell me what else needs to do after modifying the LoggerActionExecuter.java?

thx in advance…
2 REPLIES 2

derek
Star Contributor
Star Contributor
Hi,

The logger action can only be triggered by an appropriate rule.  Currently in the UI, this can be either of Inbound, Outbound or Updated.  This is an example of how to write an action and probably not really what you are looking for.

I presume that you want to get some low-level logging of certain service calls.  In that case, you might consider plugging in an interceptor in the same way that the public-services-context.xml beans have interceptors to handle authentication, exception translation and, ofcourse, transactions.

Your interceptor can be wired in using a bean override of the appropriate services (better) or programmatically.

Examples of a similar interceptors are:

org.alfresco.util.debug.MethodCallLogAdvice
org.alfresco.util.perf.PerformanceMonitorAdvice
.

What your interceptors do when they have the execution is entirely up to you, provided that you are careful not to create infinite loops, etc.  The interceptor implementation may be a HibernateDaoSupport extension, even.  There really is no limitation.

Regards

edifabio08
Champ in-the-making
Champ in-the-making
hi

I have the same Exception after adding the example SDK TaggingSample.
what Can I do to initialize the context properly?

I use Alfresco 1.2 on Kubuntu.
Thx