|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.logging.ClfLogger
public class ClfLogger
This implements the DLESE extended form of the combined log format as documented at Apache logs docs.
The combined log format has the same first seven fields as the common log format, and adds two more fields: referrer and user-agent.
The DLESE extension to the combined log format adds several more fields, documented below.
The fields, with their normal CGI variable names, are:
-
-
samuel
[10/Nov/2002:07:48:54 -0700]
"GET /testldap/tldap HTTP/1.1"
200
7638
"-"
"http://quake.dpc.ucar.edu/index.html"
"-"
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529"
localhost
80
search
98
9000
1
"-"
"<criteria testattr=\"testval\"><field>Free Text</field><textSearchValue>oceanography</textSearchValue><textSearchTerm>oceanography</textSearchTerm><field>Grade Level</field><LearningContext>High school</LearningContext></criteria>"
public class TestServlet extends HttpServlet { ClfLogger logger = null; public void init( ServletConfig conf) throws ServletException { super.init(conf); String logfile = getInitParameter("test.log.file.name"); try { logger = DleseLogManager.getClfLogger( Level.FINEST, // minimum level this logger will accept true, // append logfile); // output log file } catch( LogException dle) { log("cannot init ClfLogger: " + dle); logger = null; } } // end init public void doGet( HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { int statusCode = 200; int contentLen = 0; int numSearchResults = 98; int numDbRecs = 9000; int rankNum = 1; String xmlString = "<someTag someAttr="xyz">some contents</someTag>"; logger.log( java.util.logging.Level.SEVERE, // message importance req, // the incoming request statusCode, // returned http status code contentLen, // returned content len, bytes "search", // type: search, full, or other numSearchResults, // num search results numDbRecs, // total num records in the database rankNum, // if search: rank of first rec in page // if full: rank of this rec null, // dleseId: if full: dlese ID of this rec xmlString); // xml stg. Will appear in double quotes. // Internal backslashes, quotes, double quotes, // newlines, etc. will be escaped. } // end doGet } // end class TestServlet
Method Summary | |
---|---|
void |
close()
|
void |
log(Level level,
HttpServletRequest req,
int statusCode,
int contentLen,
String requestType,
int numSearchResults,
int numDbRecords,
int rankNum,
String dleseId,
String xmlString)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void close() throws LogException
LogException
public void log(Level level, HttpServletRequest req, int statusCode, int contentLen, String requestType, int numSearchResults, int numDbRecords, int rankNum, String dleseId, String xmlString)
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |