Package org.dlese.dpc.logging
Class ClfLogRecord
java.lang.Object
org.dlese.dpc.logging.ClfLogRecord
Represents a single log record created by
ClfLogger.
Log files may be parsed by calling
ClfLogRecord.parse.-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe content length of the document returned to the client.If full: DLESE ID of the record returned.id.intTotal number of records in the databaseintNumber of search results for search requests; 0 otherwiseintIf search: rank of first result in the displayed page.The referrer, but long ago was misspelled it as the "referer" HTTP request header.Remote host IP number.The username as which the user has authenticated via password protection.The date and time of request, UTC (GMT) time.The request line as it came from the client.The DLESE request type: search/full/other.The name of the server that received the request.intThe port number of the server that received the request.The User_Agent HTTP request header, in quotes.An arbitrary string, generally XML. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClfLogRecordCreates a ClfLogRecord by parsing the specified input line.toString()
-
Field Details
-
remoteHost
Remote host IP number. -
identity
id. See rfc1413 (obsoletes rfc931) remote logname of the user. Unreliable, seldom used. Usually appears as "-". -
remoteUser
The username as which the user has authenticated via password protection. -
requestDateUtc
The date and time of request, UTC (GMT) time. Note: this is the time when the server wrote the log record, not the time extracted from the possibly bogus date header. -
requestString
- The request line as it came from the client. Note: this is reconstructed using HttpServletRequest calls, so there may be slight differences in formatting from the original request string.
Example: "GET /testldap/tldap HTTP/1.1" - The request line as it came from the client. Note: this is reconstructed using HttpServletRequest calls, so there may be slight differences in formatting from the original request string.
-
contentLength
public int contentLengthThe content length of the document returned to the client. -
referrer
The referrer, but long ago was misspelled it as the "referer" HTTP request header. If unavailable, it appears quoted as "-", not as -. -
userAgent
The User_Agent HTTP request header, in quotes. If unavailable, it appears quoted as "-", not as -. -
serverName
The name of the server that received the request. -
serverPort
public int serverPortThe port number of the server that received the request. -
requestType
The DLESE request type: search/full/other. -
numSearchResults
public int numSearchResultsNumber of search results for search requests; 0 otherwise -
numDbRecords
public int numDbRecordsTotal number of records in the database -
rankNum
public int rankNumIf search: rank of first result in the displayed page. If full: rank of this result. -
dleseId
If full: DLESE ID of the record returned. Otherwise: "-" -
xmlString
An arbitrary string, generally XML.
-
-
Constructor Details
-
ClfLogRecord
public ClfLogRecord()
-
-
Method Details
-
toString
-
parse
Creates a ClfLogRecord by parsing the specified input line. Sample use:int linenum = 0; BufferedReader rdr = new BufferedReader( new FileReader( inname)); while (true) { String inline = rdr.readLine(); if (inline == null) break; linenum++; ClfLogRecord rec = ClfLogRecord.parse( inline, linenum); System.out.println("\nrecord " + linenum + ":\n" + rec); } rdr.close();- Throws:
LogException
-