We will be illustrating how applications can log messages in Geronimo by using two logging frameworks, namely, log4j and JUL. We will also illustrate how you can use the slf4j wrapper to log messages with the above two underlying implementations. We will be using a sample application, namely, the HelloWorld web application to illustrate this.
We can use log4j for logging the application log to either a separate logfile or to the geronimo.log
file. We will also illustrate how the logs can be written to a separate file in the <GERONIMO_HOME>/var/log
directory, by using a GBean.
Logging to the geronimo.log
file and the command console is the simplest way to do application logging in Geronimo. For enabling this in your application, you only need to add logging statements to your application code. The HelloWorld sample application has a servlet called HelloWorldServlet
, which has the following...