public class OliDatabaseLogger extends AbstractMessageLogger
This does not create a file, see OliDiskLogger or FileLogger to create a file.
CLOSE_ROOT_NODE, ENCODING_ISO_8859_1, ENCODING_UTF8, INFO_TYPE, PROD_URL, QA_URL
Constructor and Description |
---|
OliDatabaseLogger(edu.cmu.oli.log.client.StreamLogger streamLogger,
java.lang.String encoding)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Does nothing.
|
static OliDatabaseLogger |
create(boolean prodFlag)
Create the message logger.
|
static OliDatabaseLogger |
create(boolean prodFlag,
java.lang.String encoding)
Create the message logger.
|
static OliDatabaseLogger |
create(java.lang.String url,
java.lang.String encoding)
Create the message logger and log to the given URL.
|
boolean |
log(Message message)
Logs a message to the previously given file.
|
boolean |
log(Message message,
java.util.Date timeStamp)
Logs a message with a new time stamp.
|
boolean |
log(java.lang.String authToken,
Message message)
Logs a message with an authentication token.
|
boolean |
log(java.lang.String authToken,
Message message,
java.util.Date timeStamp)
Logs a message with a new time stamp, and an authentication token.
|
void |
logSession(java.lang.String userName,
java.lang.String sessionId)
Log a SessionLog record.
|
getCloseXml, getOpenXml, getOpenXmlSchemaType
public OliDatabaseLogger(edu.cmu.oli.log.client.StreamLogger streamLogger, java.lang.String encoding)
streamLogger
- the OLI stream loggerencoding
- the encoding to be indicated at the top of the XMLpublic static OliDatabaseLogger create(boolean prodFlag)
prodFlag
- indicates whether to log to the production serverpublic static OliDatabaseLogger create(boolean prodFlag, java.lang.String encoding)
prodFlag
- indicates whether to log to the production serverencoding
- the encoding to be indicated at the top of the XMLpublic static OliDatabaseLogger create(java.lang.String url, java.lang.String encoding)
url
- indicates the URL for the logging serverencoding
- the encoding to be indicated at the top of the XMLpublic boolean log(Message message)
message
- the message to log to the filepublic boolean log(java.lang.String authToken, Message message)
message
- the message to logauthToken
- the authentication token needed for authenticated logging (OLI servers)public boolean log(Message message, java.util.Date timeStamp)
message
- the message to logtimeStamp
- the new time stamp to usepublic boolean log(java.lang.String authToken, Message message, java.util.Date timeStamp)
message
- the message to logtimeStamp
- the new time stamp to useauthToken
- the authentication token needed for authenticated logging (OLI servers)public void logSession(java.lang.String userName, java.lang.String sessionId)
userName
- the user namesessionId
- the session idSessionLog
public void close()
Copyright (c) 2015 - Pittsburgh Science of Learning Center