Package simpleorm.utils
Class SLogSlf4j
- java.lang.Object
-
- simpleorm.utils.SLog
-
- simpleorm.utils.SLogSlf4j
-
- Direct Known Subclasses:
SormLog
public class SLogSlf4j extends SLog
An implementation of SLog to allow Simpleorm to log via Slf4j. Log level is then controlled by slf4j, not by SLog.slog.level.Mapping between SLog and slf4j log levels is:
SLog Slf4j - Marker ---------------- -------------------- debug (30) debug warn warn message warn error error connections (10) info updates (20) debug SORM_UPDATE queries (30) debug SORM_QUERY fields (40) trace SORM_FIELD
To use this logging API, you must: 1) SLog.setSlogClass(SLogSlf4j.class); somewhere early in you app (in you servlet init sequence for example) 2) make sure you have a slf4j implementation in your classpath (logback, simplelogger, etc.)
Configure slf4j, for examples, @see http://www.slf4j.org/
-
-
Field Summary
Fields Modifier and Type Field Description intlevel
-
Constructor Summary
Constructors Constructor Description SLogSlf4j()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringarrayToString(java.lang.Object[] array)voidconnections(java.lang.String msg)voiddebug(java.lang.String msg)booleanenableDebug()For detailed temporary traces during development only.booleanenableFields()set/get per field.booleanenableQueries()booleanenableUpdates()voiderror(java.lang.String msg)voidfields(java.lang.String msg)voidmessage(java.lang.String msg)For messages that are the output, eg.voidqueries(java.lang.String msg)voidupdates(java.lang.String msg)voidwarn(java.lang.String msg)-
Methods inherited from class simpleorm.utils.SLog
getLevel, getSession, getSessionlessLogger, getSlogClass, getStream, log, newSLog, sessionToString, setLevel, setSession, setSlogClass
-
-
-
-
Method Detail
-
connections
public void connections(java.lang.String msg)
- Overrides:
connectionsin classSLog
-
enableUpdates
public boolean enableUpdates()
- Overrides:
enableUpdatesin classSLog
-
enableQueries
public boolean enableQueries()
- Overrides:
enableQueriesin classSLog
-
enableFields
public boolean enableFields()
set/get per field. enableFields enables the trace line to be surounded by an if test which is important as fields are an inner loop trace and the StringBuffer concatenation can be very expensive!- Overrides:
enableFieldsin classSLog
-
enableDebug
public boolean enableDebug()
For detailed temporary traces during development only.- Overrides:
enableDebugin classSLog
-
message
public void message(java.lang.String msg)
For messages that are the output, eg. of unit test programs. Never disabled.
-
arrayToString
public static java.lang.String arrayToString(java.lang.Object[] array)
-
-