Logging, Konfiguration

Zum Logging auf Log-Files und zur Konfiguration sollten Singletons verwendet werden. Beachten Multithreading-Problematik Logging: kann zum Bremsen des Servers führen Konfiguration: auf Seiteneffekte achten Logging über log-Methoden des Servers log(String) - Method in interface javax.servlet.ServletContext Writes the specified message to a servlet log file, usually an event log. log(String) - Method in class javax.servlet.GenericServlet Writes the specified message to a servlet log file, prepended by the servlet's name. log(String, Throwable) - Method in interface javax.servlet.ServletContext Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file. log(String, Throwable) - Method in class javax.servlet.GenericServlet Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file, prepended by the servlet's name. System.out.println() sollte nicht verwendet werden. Konfiguration Möglich über Properties-Files Einlesen Initialization-Parameter aus web.xml Verwendung von Resourcebundles Internationalisierung über application-Parameter in web.xml <init-param> <param-name>application</param-name> <param-value>package.ApplicationResources</param-value> </init-param>
Home Anfang weiter