Package com.avoka.core.groovy
Class SecurityLogger
java.lang.Object
com.avoka.core.groovy.SecurityLogger
- All Implemented Interfaces:
IBindable
Provides a Security Logger class for logging information during the execution of Security Manager SSO Filter scripts. Log message are logged to the server log
file with the category com.avoka.core.groovy.SecurityLogger.
Example
The Groovy script example below imports the SecurityLogger class with the name 'logger' and then calls the debug, info, warn and error methods.
import com.avoka.core.groovy.SecurityLogger as logger logger.debug 'this is a DEBUG level message' logger.info 'this is an INFO level message' logger.warn 'this is an WARN level message' logger.error 'this is an ERROR level message'
This will result in the following logger messages being logged to the server log file. Note only WARN and ERROR level messages are logged by default.
13:30:33,011 WARN [com.avoka.core.groovy.SecurityLogger] (pool-5-thread-1) this is an WARN level message 13:30:33,012 ERROR [com.avoka.core.groovy.SecurityLogger] (pool-5-thread-1) this is an ERROR level message
Note you can modify the standalone.xml configuration file to change category filtering level to show INFO and DEBUG level messages.
<logger category="com.avoka.core.groovy.SecurityLogger">
<level name="WARN"/>
</logger> - Since:
- 5.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the thread logs.static voidLog the given DEBUG level message.static voidLog the given DEBUG level message.static voidLog the given ERROR level message.static voidLog the given ERROR level message.static StringBuilderReturn the thread local INFO level log.static voidLog the given INFO level message.static voidLog the given INFO level message.static voidSet the thread local INFO level log.static voidLog the given WARN level message.static voidLog the given WARN level message.
-
Constructor Details
-
SecurityLogger
public SecurityLogger()
-
-
Method Details
-
debug
Log the given DEBUG level message.- Parameters:
object- the DEBUG level message
-
debug
Log the given DEBUG level message.- Parameters:
object- the DEBUG level message
-
error
Log the given ERROR level message.- Parameters:
object- the ERROR level message
-
error
Log the given ERROR level message.- Parameters:
object- the ERROR level message
-
info
Log the given INFO level message.- Parameters:
object- the INFO level message
-
info
Log the given INFO level message.- Parameters:
object- the INFO level message
-
warn
Log the given WARN level message.- Parameters:
object- the WARN level message
-
warn
Log the given WARN level message.- Parameters:
object- the WARN level message
-
getThreadLogMessage
Return the thread local INFO level log.- Returns:
- the thread local INFO level log
-
setThreadLogMessage
Set the thread local INFO level log.- Parameters:
log- set the INFO local debug level log
-
clearTheadLogs
public static void clearTheadLogs()Clear the thread logs. -
getBindingName
- Specified by:
getBindingNamein interfaceIBindable- Returns:
- the binding name "securityLogger".
- See Also:
-
getBindingType
- Specified by:
getBindingTypein interfaceIBindable- Returns:
- the binding type ElementType.FIELD
- See Also:
-