Logging involves the automatic recording of progress as an application runs. Tapestry makes extensive use of SLF4J to log details about the creation and operation of your page and component classes.
...
The default configuration for logging uses Log4J as the logging toolkit, though this can be changed.
Class to Logger
The logger name for a page or component matches the fully qualified class name. You can configure this in log4j.properties:
Code Block | ||
---|---|---|
| ||
log4j.category.org.apache.tapestry5.integration.app1.pages.MerryChristmas=trace
|
Injecting Loggers
You may mark a field of type Logger with the @Inject annotation. The proper Logger for your page or component will be injected.
Code Block | ||||
---|---|---|---|---|
| ||||
public class MyPage { @Inject private Logger logger; . . . void onSuccessFromForm() { logger.info("Changes saved successfully"); } |
...