1 28 29 package com.caucho.http.log; 30 31 import com.caucho.log.Log; 32 import com.caucho.vfs.WriteStream; 33 34 import javax.servlet.ServletContext ; 35 import javax.servlet.ServletException ; 36 import javax.servlet.http.HttpServletRequest ; 37 import javax.servlet.http.HttpServletResponse ; 38 import java.io.IOException ; 39 import java.util.logging.Logger ; 40 41 44 abstract public class AbstractErrorLog { 45 protected static final Logger log = Log.open(AbstractErrorLog.class); 46 47 protected WriteStream logStream; 48 49 52 public WriteStream getLogStream() 53 { 54 return logStream; 55 } 56 57 60 public void setLogStream(WriteStream os) 61 { 62 this.logStream = os; 63 } 64 65 68 public void init() 69 throws ServletException , IOException 70 { 71 } 72 73 81 public abstract void log(String message, 82 HttpServletRequest request, 83 HttpServletResponse response, 84 ServletContext application) 85 throws IOException ; 86 87 96 public abstract void log(String message, 97 Throwable exception, 98 HttpServletRequest request, 99 HttpServletResponse response, 100 ServletContext application) 101 throws IOException ; 102 103 106 public void destroy() 107 throws IOException 108 { 109 } 110 } 111 | Popular Tags |