de.innovationgate.wgpublisher.log
public class AppLog extends Object implements WGAAwareService
Modifier and Type | Class and Description |
---|---|
static class |
AppLog.Message
An applog message.
|
static class |
AppLog.Page
A page of applog content
|
Modifier and Type | Field and Description |
---|---|
static int |
SEARCHTYPE_PLAINTEXT
Search type which searches for the given string as plaintext
|
static int |
SEARCHTYPE_REGEXP
Searchtype which searches for the given string as regular expression,
matching a single applog line.
|
Constructor and Description |
---|
AppLog() |
Modifier and Type | Method and Description |
---|---|
int |
getLinesCount()
Returns the current number of lines in the applog
|
AppLog.Page |
getPage(int offset,
int size)
Retrieves a page of applog content, containing messages of all log levels
|
AppLog.Page |
getPage(int offset,
int size,
de.innovationgate.wga.common.LogLevel loglevel)
Retrieves a page of applog content
|
void |
injectWGA(WGA wga)
Callback method by which the
WGA object is injected |
int |
search(int searchStartLine,
String searchString,
int searchType,
boolean forward)
Searches the applog for a term or via regular expression
|
int |
searchTime(Date time)
Searches for the earliest message whose log time is equal or later than the given time
|
AppLog.Page |
writePage(int offset,
int size,
Writer out,
de.innovationgate.wga.common.LogLevel loglevel,
boolean lineNumbers)
Writes the content of an applog page to a writer.
|
public static final int SEARCHTYPE_PLAINTEXT
public static final int SEARCHTYPE_REGEXP
public AppLog.Page getPage(int offset, int size, de.innovationgate.wga.common.LogLevel loglevel)
offset
- The offset of the first line to retrieve, 1 being the first
line in the applogsize
- The number of messages to retrieveloglevel
- The minimum log level of messages to retrievepublic AppLog.Page getPage(int offset, int size)
offset
- The offset of the first line to retrieve, 1 being the first
line in the applogsize
- The number of messages to retrievepublic int searchTime(Date time)
time
- The log time to searchpublic AppLog.Page writePage(int offset, int size, Writer out, de.innovationgate.wga.common.LogLevel loglevel, boolean lineNumbers)
AppLog.Page
object. Note that this object does not
contain the page content.offset
- The offset of the first line to retrieve, 0 being the first
line in the applogsize
- The number of messages to retrieveout
- The writer to write log content tologlevel
- The minimum log level of messages to retrievelineNumbers
- If true all written log lines will be prefixed with line
numberspublic int getLinesCount()
public void injectWGA(WGA wga)
WGAAwareService
WGA
object is injectedinjectWGA
in interface WGAAwareService
wga
- The object used to instantiate the service via WGA.service(Class)
public int search(int searchStartLine, String searchString, int searchType, boolean forward) throws IOException
searchStartLine
- The number of the line where to start searchsearchString
- The term or regular expression to search forsearchType
- Type of the search, either SEARCHTYPE_PLAINTEXT
or
SEARCHTYPE_REGEXP
forward
- true to search forward from the starting line, false to search
backwardIOException