Class LogsClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.runtime.plugins.admin.logs.LogsClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class LogsClientSideElement extends StaticClientSideElement
Client side element for log actions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__LOGS_BASE
The path to the application's logs folderprivate SourceResolver
_sourceResolver
The Excalibur source resolver-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description LogsClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_changeLogLevel(LoggerRepository loggerRepository, String category, String mode)
private boolean
_deleteFile(String fileLocation)
Map<String,Object>
changeLogLevel(String level, String category)
Change the log level of the selected category to the selected levelMap<String,Object>
deleteLogs(List<String> files)
Delete the log filesMap<String,Object>
purgeLogs()
Delete the log entries that are at least 12 days oldvoid
service(ServiceManager serviceManager)
-
Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
-
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__LOGS_BASE
private static final String __LOGS_BASE
The path to the application's logs folder- See Also:
- Constant Field Values
-
_sourceResolver
private SourceResolver _sourceResolver
The Excalibur source resolver
-
-
Constructor Detail
-
LogsClientSideElement
public LogsClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
deleteLogs
public Map<String,Object> deleteLogs(List<String> files) throws ProcessingException, IOException
Delete the log files- Parameters:
files
- the files to delete- Returns:
- the result map with the successes and failures files.
- Throws:
IOException
- if an error occurred during deletionProcessingException
- if an error occurred during deletion
-
purgeLogs
public Map<String,Object> purgeLogs() throws ProcessingException
Delete the log entries that are at least 12 days old- Returns:
- the result
- Throws:
ProcessingException
- if an exception occurs while processing the deletion
-
_deleteFile
private boolean _deleteFile(String fileLocation) throws IOException, ProcessingException
- Throws:
IOException
ProcessingException
-
changeLogLevel
public Map<String,Object> changeLogLevel(String level, String category)
Change the log level of the selected category to the selected level- Parameters:
level
- the selected levelcategory
- the selected category- Returns:
- a map
-
_changeLogLevel
private void _changeLogLevel(LoggerRepository loggerRepository, String category, String mode)
-
-