Package org.jboss.as.controller.audit
Interface ManagedAuditLogger
-
- All Superinterfaces:
AuditLogger
- All Known Implementing Classes:
ManagedAuditLoggerImpl
public interface ManagedAuditLogger extends AuditLogger
Abstract base class forAuditLoggerimplementations.- Author:
- Brian Stansberry (c) 2012 Red Hat Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceManagedAuditLogger.AuditLogHandlerUpdaterThe audit log handler updater.-
Nested classes/interfaces inherited from interface org.jboss.as.controller.audit.AuditLogger
AuditLogger.Status
-
-
Field Summary
-
Fields inherited from interface org.jboss.as.controller.audit.AuditLogger
NO_OP_LOGGER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddFormatter(AuditLogItemFormatter formatter)Add a formattervoidbootDone()Callback for the controller to call when the controller has been bootedManagedAuditLoggercreateNewConfiguration(boolean manualCommit)Create another audit logger configuration, e.g.booleangetHandlerDisabledDueToFailure(String name)Get whether a handler was disabled due to failuresintgetHandlerFailureCount(String name)Get the current failure count of a handlerJsonAuditLogItemFormattergetJsonFormatter(String name)Gets a formatter by its nameAuditLogger.StatusgetLoggerStatus()Gets the status of the audit loggerManagedAuditLogger.AuditLogHandlerUpdatergetUpdater()Gets the handler updater used to schedule updates to the handlersbooleanisLogBoot()Get whether this audit logger logs operations on bootbooleanisLogReadOnly()Get whether this audit logger logs read-only operationsdefault List<org.jboss.dmr.ModelNode>listLastEntries(String name)Gets the last log entriesvoidrecycleHandler(String name)Recycles a handler.voidremoveFormatter(String name)Remove a formattervoidsetLogBoot(boolean logBoot)Set whether to log operations on bootvoidsetLoggerStatus(AuditLogger.Status newStatus)Sets the status of the audit loggervoidsetLogReadOnly(boolean logReadOnly)Set whether to log read-only operationsvoidstartBoot()Callback for the controller to call before the controller is bootedvoidupdateHandlerFormatter(String name, String formatterName)Update the handler formatter.voidupdateHandlerMaxFailureCount(String name, int count)Update the handler max failure count.voidupdateInMemoryHandlerMaxHistory(String name, int maxHistory)Update the handler history size.voidupdateSyslogHandlerAppName(String name, String appName)Update the handler app-name.voidupdateSyslogHandlerFacility(String name, SyslogAuditLogHandler.Facility facility)Update the syslog handler facility.voidupdateSyslogHandlerReconnectTimeout(String name, int reconnectTimeout)Update the handler reconnect timeout.-
Methods inherited from interface org.jboss.as.controller.audit.AuditLogger
log, logJmxMethodAccess
-
-
-
-
Method Detail
-
isLogReadOnly
boolean isLogReadOnly()
Get whether this audit logger logs read-only operations- Returns:
- whether this audit logger logs read-only operations
-
setLogReadOnly
void setLogReadOnly(boolean logReadOnly)
Set whether to log read-only operations- Parameters:
logReadOnly- wheter to log read-only operations
-
isLogBoot
boolean isLogBoot()
Get whether this audit logger logs operations on boot- Returns:
- whether this audit logger logs operations on boot
-
setLogBoot
void setLogBoot(boolean logBoot)
Set whether to log operations on boot- Parameters:
logBoot- whether to log operations on boot
-
getLoggerStatus
AuditLogger.Status getLoggerStatus()
Gets the status of the audit logger- Returns:
- the status
-
setLoggerStatus
void setLoggerStatus(AuditLogger.Status newStatus)
Sets the status of the audit logger- Parameters:
newStatus- the status
-
getUpdater
ManagedAuditLogger.AuditLogHandlerUpdater getUpdater()
Gets the handler updater used to schedule updates to the handlers- Returns:
- the handler updater
-
recycleHandler
void recycleHandler(String name)
Recycles a handler. This stops it, and resets the failure count so that the next time it is used it will reinitialize.- Parameters:
name- the name of the handler
-
createNewConfiguration
ManagedAuditLogger createNewConfiguration(boolean manualCommit)
Create another audit logger configuration, e.g. for JMX which has its own global config of the audit logger- Parameters:
manualCommit- iftruethe caller is responsible for applying the changes themselves, iffalsethe changes will be committed after the next log records has been written- Returns:
- the new configuration
-
addFormatter
void addFormatter(AuditLogItemFormatter formatter)
Add a formatter- Parameters:
formatter- the formatter
-
updateHandlerFormatter
void updateHandlerFormatter(String name, String formatterName)
Update the handler formatter. This will take effect immediately.- Parameters:
name- the name of the handlerformatterName- the name of the formatter
-
updateHandlerMaxFailureCount
void updateHandlerMaxFailureCount(String name, int count)
Update the handler max failure count. This will take effect immediately- Parameters:
name- the name of the handlercount- the max failure count
-
updateSyslogHandlerFacility
void updateSyslogHandlerFacility(String name, SyslogAuditLogHandler.Facility facility)
Update the syslog handler facility. This will take effect immediately.- Parameters:
name- the name of the syslog handlerfacility- the facility
-
updateSyslogHandlerAppName
void updateSyslogHandlerAppName(String name, String appName)
Update the handler app-name. This will take effect immediately- Parameters:
name- the name of the handlerappName- the app name
-
updateSyslogHandlerReconnectTimeout
void updateSyslogHandlerReconnectTimeout(String name, int reconnectTimeout)
Update the handler reconnect timeout. This will take effect immediately- Parameters:
name- the name of the handlerreconnectTimeout- the app name
-
updateInMemoryHandlerMaxHistory
void updateInMemoryHandlerMaxHistory(String name, int maxHistory)
Update the handler history size.- Parameters:
name- the name of the handlermaxHistory- the history size of the handler
-
removeFormatter
void removeFormatter(String name)
Remove a formatter- Parameters:
name- the formatter name
-
getHandlerFailureCount
int getHandlerFailureCount(String name)
Get the current failure count of a handler- Parameters:
name- the name of the handler- Returns:
- the failure count
-
getHandlerDisabledDueToFailure
boolean getHandlerDisabledDueToFailure(String name)
Get whether a handler was disabled due to failures- Parameters:
name- the name of the handler- Returns:
- whether it is disabled
-
getJsonFormatter
JsonAuditLogItemFormatter getJsonFormatter(String name)
Gets a formatter by its name- Parameters:
name- the name of the formatter- Returns:
- the formatter
-
listLastEntries
default List<org.jboss.dmr.ModelNode> listLastEntries(String name)
Gets the last log entries- Parameters:
name- the name of the handler- Returns:
- the last log entries of the handler
-
startBoot
void startBoot()
Callback for the controller to call before the controller is booted
-
bootDone
void bootDone()
Callback for the controller to call when the controller has been booted
-
-