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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) Get the appenderGet or Create a categoryvoid
setPluginInfo
(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:ExternalLog
Get the appender- Specified by:
getAppender
in interfaceExternalLog
- Returns:
- an appender that can be added to a category
- Throws:
IOException
-
getCategory
Description copied from interface:ExternalLog
Get or Create a category- Specified by:
getCategory
in interfaceExternalLog
- Returns:
- a category from logManager
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
setPluginInfo
Description copied from interface:PluginAware
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.- Specified by:
setPluginInfo
in 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
-