| | |
| | | */ |
| | | public class WebApp implements ServletContextListener { |
| | | |
| | | public static final String P_LOGGERNAME = "loggername"; |
| | | /*public static final String P_LOGGERNAME = "loggername"; |
| | | public static final String P_LOGDIRNAME = "logdirname"; |
| | | public static final String P_LOGFILENAME = "logfilename"; |
| | | public static final String P_LOGFILESIZE = "logfilesize"; |
| | | public static final String P_LOGFILECOUNT = "logfilecount"; |
| | | public static final String P_LOGLEVEL = "loglevel"; |
| | | public static final String P_LOGLEVEL = "loglevel";*/ |
| | | |
| | | public static final String P_DEBUG = "debug"; |
| | | |
| | | public static final String WEBAPP_LOGGER = "webapplogger"; |
| | | |
| | | /* |
| | | private Level getLevel(String levelStr) { |
| | | Level level = Level.INFO; |
| | | if(levelStr.equalsIgnoreCase(Level.ALL.getName())) { |
| | |
| | | } |
| | | return level; |
| | | } |
| | | |
| | | */ |
| | | public void contextInitialized(ServletContextEvent event) { |
| | | ServletContext servletContext = event.getServletContext(); |
| | | /* |
| | | Object o = servletContext.getAttribute(WEBAPP_LOGGER); |
| | | |
| | | if(o == null) { |
| | | String loggername = servletContext.getInitParameter(P_LOGGERNAME); // Name der root Package dieser Anwendung |
| | | String logdirname = servletContext.getInitParameter(P_LOGDIRNAME); |
| | |
| | | } else { |
| | | // logger ist schon da |
| | | } |
| | | */ |
| | | } |
| | | |
| | | public void contextDestroyed(ServletContextEvent event) { |
| | | ServletContext servletContext = event.getServletContext(); |
| | | /* |
| | | Object o = servletContext.getAttribute(WEBAPP_LOGGER); |
| | | if(o != null) { |
| | | Logger logger = (Logger) o; |
| | |
| | | servletContext.removeAttribute(WEBAPP_LOGGER); |
| | | logger = null; |
| | | } |
| | | */ |
| | | } |
| | | |
| | | /** |