Package org.ametys.runtime.log
Class StaticExternalLog
java.lang.Object
org.ametys.runtime.log.StaticExternalLog
- All Implemented Interfaces:
ExternalLog,PluginAware,Configurable
Default static implementation of
ExternalLog
For implementing the ExternalLog interface (while being Configurable), extends this class and implements the getAppender() and/or getCategory() methods.
Example of XML
<extension id="runtime.core.externalLogger.myTest"
class="org.ametys.runtime.log.StaticExternalLog"
point="org.ametys.runtime.log.ExternalLogExtensionPoint">
<appender-name>my-logger</appender-name>
<category-name>com.example.mylog</category-name>
<file-prefix>my-file-name</file-prefix>
<additive>false</additive>
<rolling-file>true</rolling-file>
<log-level>INFO</log-level>
</extension>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) Get the appenderGet or Create a categoryvoidsetPluginInfo(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.
-
Field Details
-
PATTERN_LAYOUT
default layout pattern- See Also:
-
DEFAULT_LEVEL
Default log level
-
-
Constructor Details
-
StaticExternalLog
public StaticExternalLog()
-
-
Method Details
-
getAppender
Description copied from interface:ExternalLogGet the appender- Specified by:
getAppenderin interfaceExternalLog- Returns:
- an appender that can be added to a category
- Throws:
IOException
-
getCategory
Description copied from interface:ExternalLogGet or Create a category- Specified by:
getCategoryin interfaceExternalLog- Returns:
- a category from logManager
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
setPluginInfo
Description copied from interface:PluginAwareSets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfoin interfacePluginAware- Parameters:
pluginName- Unique identifier for the plugin hosting the extensionfeatureName- Unique feature identifier (unique for a given pluginName)id- Unique identifier of this component
-