Unfortunately not. It's not toString() - I was going to go that route originally, but was concerned about calling application code during event creation, since that could lead to more events being generated, and make performance unpredictable.
Currently I think you'd have to make your own AOP adviser, and call BehaviorTrackingManager directly. Then you can control how the event is created. Take a look at BehaviorTrackingAdvice:
This is obviously a shortcoming or the implementation. I've got a couple of ideas about how this could be improved:
* we currently convert method arguments to string when the event is created. instead, we could store a reference to the argument, and render it when the event is persisted. calling toString() in the persister might be safer.
* we could make calling toString() a configuration option
* we could provide some kind of 'EventDataRenderer' interface for applications to implement.
* some combination of these
personally i kind of like the 'EventDataRenderer' interface idea. what do you think?
jason
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jason,
good point with the toString method. I did not really thing about that. I like your idea about the EventDataRenderer. That way it becomes easier to use your knowledge on the method being monitored.
The toString approach might then become a very easy implementation of that same interface.
I had a good look at the aspect. Does not look to hard to implement something myself. Would be nice to have some kind of base aspect that can easily be extended. I'll try to come up with an example the coming days.
Jettro
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it possible to influence what is written to the event log? In each event I get a message like this:
<event-data>
<parameters>
<param type="org.springframework.integration.message.GenericMessage">{object}</param>
</parameters>
<result type="java.util.ArrayList">{object}</result>
</event-data>
I would like to now more about {object}, can we influence what is written here? Is it the toString?
Hey Jettro,
Unfortunately not. It's not toString() - I was going to go that route originally, but was concerned about calling application code during event creation, since that could lead to more events being generated, and make performance unpredictable.
Currently I think you'd have to make your own AOP adviser, and call BehaviorTrackingManager directly. Then you can control how the event is created. Take a look at BehaviorTrackingAdvice:
http://beet.git.sourceforge.net/git/gitweb.cgi?p=beet/beet;a=blob;f=core/src/main/java/com/mtgi/analytics/aop/BehaviorTrackingAdvice.java
see my comment on line 104 in particular :)
This is obviously a shortcoming or the implementation. I've got a couple of ideas about how this could be improved:
* we currently convert method arguments to string when the event is created. instead, we could store a reference to the argument, and render it when the event is persisted. calling toString() in the persister might be safer.
* we could make calling toString() a configuration option
* we could provide some kind of 'EventDataRenderer' interface for applications to implement.
* some combination of these
personally i kind of like the 'EventDataRenderer' interface idea. what do you think?
jason
Hi Jason,
good point with the toString method. I did not really thing about that. I like your idea about the EventDataRenderer. That way it becomes easier to use your knowledge on the method being monitored.
The toString approach might then become a very easy implementation of that same interface.
I had a good look at the aspect. Does not look to hard to implement something myself. Would be nice to have some kind of base aspect that can easily be extended. I'll try to come up with an example the coming days.
Jettro