public interface LoggerService extends AppContextService<LoggerService>
uk.ac.ed.epcc.webapp.Logger log = c.getService(LoggerService.class).getLogger(getClass()); // gets logger for this class
log.debug("A debug message");
log.error("A error message");
Logger is a locally defined interface. In a servlet context this is usually a wrapper round a
Log4J Logger class. However in a stand-alone context a the Logger just prints to System.out
This is to allow lightweight applications to run without the full Log4J jar files and
makes it easier to switch to a different logging system.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SECURITY_LOG |
Modifier and Type | Method and Description |
---|---|
Logger |
getLogger(java.lang.Class c) |
Logger |
getLogger(java.lang.String name) |
default void |
initialiseLogging()
Initialise the logging system.
|
default void |
securityEvent(java.lang.String event,
SessionService sess) |
default void |
securityEvent(java.lang.String event,
SessionService sess,
java.util.Map context)
Log a security event.
|
default void |
shutdownLogging()
shutdown the logging system called once per application
|
getType
cleanup
static final java.lang.String SECURITY_LOG
Logger getLogger(java.lang.String name)
Logger getLogger(java.lang.Class c)
default void initialiseLogging()
default void shutdownLogging()
default void securityEvent(java.lang.String event, SessionService sess, java.util.Map context)
event
- sess
- SessionService
context
- default void securityEvent(java.lang.String event, SessionService sess)