Package org.opencms.ui.apps.logfile
Class CmsLogFileApp
java.lang.Object
org.opencms.ui.apps.A_CmsWorkplaceApp
org.opencms.ui.apps.logfile.CmsLogFileApp
- All Implemented Interfaces:
I_CmsCRUDApp<org.apache.logging.log4j.core.Logger>,I_CmsWorkplaceApp
public class CmsLogFileApp
extends A_CmsWorkplaceApp
implements I_CmsCRUDApp<org.apache.logging.log4j.core.Logger>
Main class of Log management app.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
A_CmsWorkplaceApp.NavEntry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringLog folder path.protected CmsLogFileViewThe log file view layout.protected CmsLogChannelTableThe log-channel table.protected static StringPath to channel settings view.Fields inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
m_infoLayout, m_rootLayout, m_uiContext, PARAM_ASSIGN, PARAM_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidButton to open channel settings path.protected voidAdds the download button.voidAdds a marker entry to the currently selected log file.protected voidButton to add a marker to the current log file.protected voidAdds the publish button.protected voidButton to refresh the file view.protected voidButton to open log file view settings dialog.voidcreateElement(org.apache.logging.log4j.core.Logger element) Creates the element of type T in the system.voiddefaultAction(String elementId) Performs a default action.voiddeleteElements(List<String> elementId) Delete the given List of elements.protected voidfilterTable(String filter) Filters the table.List<org.apache.logging.log4j.core.Logger> Get all Elements.Gets the available log file paths.protected LinkedHashMap<String, String> getBreadCrumbForState(String state) Returns the current bread crumb entries in an ordered map.protected com.vaadin.ui.ComponentgetComponentForState(String state) Returns the app component for the given state.getDefaultLogFilePath(CmsRfsFileViewer logView) Gets the default log file path.static StringgetDirectLogFile(org.apache.logging.log4j.core.Logger logger) Gets the direct log filename of a given logger or null if no file is defined.org.apache.logging.log4j.core.LoggergetElement(String elementId) Reads out an element.static StringgetFileName(org.apache.logging.log4j.core.Appender app) Returns the file name ornullassociated with the given appender.protected I_CmsLogDownloadProviderGets the download provider for the log download dialog.getLogFile(org.apache.logging.log4j.core.Logger logger) Gets the log file for the logger.getLogFilePortion(CmsRfsFileViewer logView, String currentFile) Gets the portion of given log file.protected List<A_CmsWorkplaceApp.NavEntry> getSubNavEntries(String state) Returns the sub navigation entries.voidinitUI(I_CmsAppUIContext context) Within this method the app UI should be initialized.static booleanisFileAppender(org.apache.logging.log4j.core.Appender appender) Checks whether the given log appender has a getFileName method to identify file based appenders.static booleanisloggingactivated(org.apache.logging.log4j.core.Logger logchannel) Simple check if the logger has the global log filestatic voidtoggleOwnFile(org.apache.logging.log4j.core.Logger logchannel) Toggles the log file.voidtoggleOwnFileForLogger(org.apache.logging.log4j.core.Logger logchannel) Toggles if channel has own log file.voidUpdates the log channel table.voidwriteElement(org.apache.logging.log4j.core.Logger logger) Writes a changed element to the system which already exists.Methods inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
addParamToState, addSubNavEntry, getLastPathLevel, getOfflineCmsObject, getParamFromState, getParamsFromState, onStateChange, openSubView, removeParamsFromState, setBreadCrumbEntries, updateBreadCrumb, updateSubNav
-
Field Details
-
LOG_FOLDER
Log folder path. -
PATH_LOGCHANNEL
Path to channel settings view. -
m_fileView
The log file view layout. -
m_table
The log-channel table.
-
-
Constructor Details
-
CmsLogFileApp
public CmsLogFileApp()
-
-
Method Details
-
getDirectLogFile
Gets the direct log filename of a given logger or null if no file is defined.- Parameters:
logger- to be checked- Returns:
- Log file name or null
-
getFileName
Returns the file name ornullassociated with the given appender.- Parameters:
app- the appender- Returns:
- the file name
-
isFileAppender
Checks whether the given log appender has a getFileName method to identify file based appenders.As since log4j 2.0 file appenders don't have one common super class that allows access to the file name, but they all implement a method 'getFileName'.
- Parameters:
appender- the appender to check- Returns:
- in case of a file based appender
-
isloggingactivated
Simple check if the logger has the global log fileor a single one.
- Parameters:
logchannel- the channel that has do be checked- Returns:
- true if the the log channel has a single log file
-
toggleOwnFile
Toggles the log file.- Parameters:
logchannel- to toggle log file for
-
addMark
Adds a marker entry to the currently selected log file.- Parameters:
logFile- the log file name
-
createElement
Description copied from interface:I_CmsCRUDAppCreates the element of type T in the system.- Specified by:
createElementin interfaceI_CmsCRUDApp<org.apache.logging.log4j.core.Logger>- Parameters:
element- to be saved- See Also:
-
defaultAction
Description copied from interface:I_CmsCRUDAppPerforms a default action.- Specified by:
defaultActionin interfaceI_CmsCRUDApp<org.apache.logging.log4j.core.Logger>- Parameters:
elementId- id of element- See Also:
-
deleteElements
Description copied from interface:I_CmsCRUDAppDelete the given List of elements.- Specified by:
deleteElementsin interfaceI_CmsCRUDApp<org.apache.logging.log4j.core.Logger>- Parameters:
elementId- of elements to be deleted- See Also:
-
getAllElements
Description copied from interface:I_CmsCRUDAppGet all Elements.- Specified by:
getAllElementsin interfaceI_CmsCRUDApp<org.apache.logging.log4j.core.Logger>- Returns:
- a list of all elements
- See Also:
-
getAvailableLogFilePaths
Gets the available log file paths.- Returns:
- Set of paths
-
getDefaultLogFilePath
Gets the default log file path.- Parameters:
logView- logview- Returns:
- log file path
-
getElement
Description copied from interface:I_CmsCRUDAppReads out an element.- Specified by:
getElementin interfaceI_CmsCRUDApp<org.apache.logging.log4j.core.Logger>- Parameters:
elementId- of the object- Returns:
- the object of type T
- See Also:
-
getLogFile
Gets the log file for the logger.- Parameters:
logger- to get log file for- Returns:
- log file
-
getLogFilePortion
public String getLogFilePortion(CmsRfsFileViewer logView, String currentFile) throws CmsRfsException, CmsRuntimeException Gets the portion of given log file.- Parameters:
logView- to get portion withcurrentFile- to read- Returns:
- portion of log file
- Throws:
CmsRfsException- exceptionCmsRuntimeException- exception
-
initUI
Description copied from interface:I_CmsWorkplaceAppWithin this method the app UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUIin interfaceI_CmsWorkplaceApp- Overrides:
initUIin classA_CmsWorkplaceApp- Parameters:
context- the UI context- See Also:
-
toggleOwnFileForLogger
Toggles if channel has own log file.- Parameters:
logchannel- to toggle
-
updateTable
Updates the log channel table. -
writeElement
Description copied from interface:I_CmsCRUDAppWrites a changed element to the system which already exists.- Specified by:
writeElementin interfaceI_CmsCRUDApp<org.apache.logging.log4j.core.Logger>- Parameters:
logger- to be saved- See Also:
-
addChannelButton
Button to open channel settings path. -
addDownloadButton
Adds the download button.- Parameters:
view- layout which displays the log file
-
addMarkButton
Button to add a marker to the current log file. -
addPublishButton
Adds the publish button. -
addRefreshButton
Button to refresh the file view. -
addSettingsButton
Button to open log file view settings dialog. -
filterTable
Filters the table.- Parameters:
filter- text to be filtered
-
getBreadCrumbForState
Description copied from class:A_CmsWorkplaceAppReturns the current bread crumb entries in an ordered map.- Specified by:
getBreadCrumbForStatein classA_CmsWorkplaceApp- Parameters:
state- the current state- Returns:
- bread crumb entry name by state, in case the state is empty, the entry will be disabled
- See Also:
-
getComponentForState
Description copied from class:A_CmsWorkplaceAppReturns the app component for the given state.- Specified by:
getComponentForStatein classA_CmsWorkplaceApp- Parameters:
state- the state to render- Returns:
- the app component
- See Also:
-
getLogDownloadProvider
Gets the download provider for the log download dialog.
-