@Service public class LogService extends Object
The contents of the trace are intended to be error, warn, info, or debug messages that help developers or users understand what the server is doing. Loggers are named after the classes in which they are generated. Each class that will use a logger must include a statement
static private Logger log = Logger.getLogger(ClassName.class.getName());where ClassName is the name of the class.
The state log is a record of state changes, intended to allow complete reconstruction of a simulation. You get one with the statement
static private Logger stateLog = Logger.getLogger("State");
Entries in the state log are of the form
type:class:id:op:arg1:...where type is one of [c,u,d] for create, update, delete; id is the identifier of the object, op (used only for update) is the operation, and the args are the arguments for that operation. The logger format will prepend the current offset from the beginning of the simulation in milliseconds.
| Constructor and Description |
|---|
LogService() |
| Modifier and Type | Method and Description |
|---|---|
String |
getPrefix() |
org.apache.logging.log4j.Logger |
getStateLogger() |
void |
setPrefix(String prefix)
Sets the filename prefix.
|
void |
startLog() |
void |
startLog(String id) |
void |
stopLog() |
public void setPrefix(String prefix)
public String getPrefix()
public org.apache.logging.log4j.Logger getStateLogger()
public void startLog()
public void startLog(String id)
public void stopLog()
Copyright © 2016 Power TAC. All Rights Reserved.