0

I want to log all event calls. For example if a user clicks on an ActionLink I want to get the information that the event Action just occurred.

In the documentation regarding logging it is stated that it's possible, but I don't quite understand how to do it. It says:

Tapestry can also debug component event logic. The component's logger, with a "tapestry.events." prefix, is used at debug level. The debugging output identifies the event name and event source, and identifies any methods that are invoked.

Note that events that are not handled by a component will bubble up to the component's container; further logging for the same event will occur using the logger associated with the container. The page containing the initial component is the final step when logging.

It's not really an instruction. I tried something similar to this, but I couldn't find a way to enable an event logging property of the logger. Currently I only set my logger to debug level like this:

org.apache.log4j.Logger.getRootLogger().setLevel(Level.DEBUG);   
org.apache.log4j.Logger.getLogger("de.[...].Edit").setLevel(Level.DEBUG);

But this only seems to enable debugging level and events are still untracked.

Also note that out of some reason I currently can't find my log4j.properties (log4j doesn't complain about it tho, so it probably does exist somewhere) file, so a solution without the requirement of this file would be nice. If that's not possible, it wouldn't be a problem either, I'd simply create a new properties file then or something like that.

MetaColon
  • 2,895
  • 3
  • 16
  • 38

1 Answers1

0

Actually I only had to properly read the documentation. The event logger is received like this:

org.apache.log4j.Logger eventLogger = org.apache.log4j.Logger.getLogger("tapestry.events.de.[...].Edit");

Which can then be set to debug similar to the normal logger:

eventLogger.setLevel(Level.DEBUG);
MetaColon
  • 2,895
  • 3
  • 16
  • 38