Class SecurityLogger

java.lang.Object
com.avoka.core.groovy.SecurityLogger
All Implemented Interfaces:
IBindable

public class SecurityLogger extends Object implements 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 Details

    • SecurityLogger

      public SecurityLogger()
  • Method Details

    • debug

      public static void debug(Object object)
      Log the given DEBUG level message.
      Parameters:
      object - the DEBUG level message
    • debug

      public static void debug(String object)
      Log the given DEBUG level message.
      Parameters:
      object - the DEBUG level message
    • error

      public static void error(Object object)
      Log the given ERROR level message.
      Parameters:
      object - the ERROR level message
    • error

      public static void error(String object)
      Log the given ERROR level message.
      Parameters:
      object - the ERROR level message
    • info

      public static void info(Object object)
      Log the given INFO level message.
      Parameters:
      object - the INFO level message
    • info

      public static void info(String object)
      Log the given INFO level message.
      Parameters:
      object - the INFO level message
    • warn

      public static void warn(Object object)
      Log the given WARN level message.
      Parameters:
      object - the WARN level message
    • warn

      public static void warn(String object)
      Log the given WARN level message.
      Parameters:
      object - the WARN level message
    • getThreadLogMessage

      public static StringBuilder getThreadLogMessage()
      Return the thread local INFO level log.
      Returns:
      the thread local INFO level log
    • setThreadLogMessage

      public static void setThreadLogMessage(StringBuilder log)
      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

      public String getBindingName()
      Specified by:
      getBindingName in interface IBindable
      Returns:
      the binding name "securityLogger".
      See Also:
    • getBindingType

      public ElementType getBindingType()
      Specified by:
      getBindingType in interface IBindable
      Returns:
      the binding type ElementType.FIELD
      See Also: