Package de.mhus.lib.core.logging
Class LogFactory
- java.lang.Object
-
- de.mhus.lib.core.logging.LogFactory
-
- All Implemented Interfaces:
IBase
- Direct Known Subclasses:
ConsoleFactory,JavaLoggerFactory,Log4JFactory,SLF4JFactory
public abstract class LogFactory extends Object implements IBase
-
-
Field Summary
Fields Modifier and Type Field Description protected Log.LEVELlevelprotected LevelMapperlevelMapper
-
Constructor Summary
Constructors Constructor Description LogFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract LogEnginecreateInstance(String name)Construct and return aLoginstance, using the factory's current set of configuration attributes.Log.LEVELgetDefaultLevel()LogEnginegetInstance(Class<?> clazz)Convenience method to derive a name from the specified class and callgetInstance(String)with it.LogEnginegetInstance(String name)Construct (if necessary) and return aLoginstance, using the factory's current set of configuration attributes.LevelMappergetLevelMapper()LogEnginegetLog(Class<?> class1)intgetMaxMessageSize()ParameterMappergetParameterMapper()voidinit()abstract voidinit(ResourceNode<?> config)voidsetDefaultLevel(Log.LEVEL level)voidsetLevelMapper(LevelMapper levelMapper)voidsetMaxMessageSize(int max)voidsetParameterMapper(ParameterMapper parameterMapper)
-
-
-
Field Detail
-
level
protected Log.LEVEL level
-
levelMapper
protected LevelMapper levelMapper
-
-
Method Detail
-
getInstance
public LogEngine getInstance(Class<?> clazz)
Convenience method to derive a name from the specified class and callgetInstance(String)with it.- Parameters:
clazz- Class for which a suitable Log name will be derived- Returns:
- The current log engine
-
init
public abstract void init(ResourceNode<?> config) throws Exception
- Throws:
Exception
-
getInstance
public LogEngine getInstance(String name)
Construct (if necessary) and return a
Loginstance, using the factory's current set of configuration attributes.NOTE - Depending upon the implementation of the
LogFactoryyou are using, theLoginstance you are returned may or may not be local to the current application, and may or may not be returned again on a subsequent call with the same name argument.- Parameters:
name- Logical name of theLoginstance to be returned (the meaning of this name is only known to the underlying logging implementation that is being wrapped)- Returns:
- the log engine
-
createInstance
public abstract LogEngine createInstance(String name)
Construct and return a
Loginstance, using the factory's current set of configuration attributes.NOTE - Depending upon the implementation of the
LogFactoryyou are using, theLoginstance you are returned may or may not be local to the current application, and may or may not be returned again on a subsequent call with the same name argument.- Parameters:
name- Logical name of theLoginstance to be returned (the meaning of this name is only known to the underlying logging implementation that is being wrapped)- Returns:
- the log engine
-
setDefaultLevel
public void setDefaultLevel(Log.LEVEL level)
-
getDefaultLevel
public Log.LEVEL getDefaultLevel()
-
getLevelMapper
public LevelMapper getLevelMapper()
-
setLevelMapper
public void setLevelMapper(LevelMapper levelMapper)
-
getParameterMapper
public ParameterMapper getParameterMapper()
-
setParameterMapper
public void setParameterMapper(ParameterMapper parameterMapper)
-
getMaxMessageSize
public int getMaxMessageSize()
-
setMaxMessageSize
public void setMaxMessageSize(int max)
-
-