Class LogManagerService
- java.lang.Object
-
- com.sun.enterprise.server.logging.LogManagerService
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct
,org.glassfish.hk2.api.PreDestroy
,LogManager
@Service @RunLevel(1) @Rank(50) public class LogManagerService extends Object implements org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, LogManager
Reinitialise the log manager using our logging.properties file.- Author:
- Jerome Dochez, Carla Mott, Naman Mehta
-
-
Constructor Summary
Constructors Constructor Description LogManagerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHandler(Handler handler)
Adds a new handler to the root loggervoid
generateAttributeChangeEvent(String property, String propertyDetail, Map props)
PrintStream
getErrStream()
File
getLoggingFile()
Returns logging file to be monitor during server is running.Map<String,String>
getLoggingProperties()
Returns properties based on the DAS/Cluster/InstancePrintStream
getOutStream()
void
listenToChangesOnloggingPropsFile(File loggingPropertiesFile, LogManager logMgr)
void
postConstruct()
Initialize the loggersvoid
preDestroy()
void
validateProp(String key, String value)
Validates a property.Map<String,String>
validateProps(Map<String,String> props)
Validates the map of logging properties.
-
-
-
Method Detail
-
getLoggingProperties
public Map<String,String> getLoggingProperties() throws IOException
Returns properties based on the DAS/Cluster/Instance- Specified by:
getLoggingProperties
in interfaceLogManager
- Throws:
IOException
-
validateProps
public Map<String,String> validateProps(Map<String,String> props)
Validates the map of logging properties. Will remove any properties from the map that don't pass the validation, and then throw an exception at the very end.- Parameters:
props
- the map of properties to validate. WILL BE MODIFIED.- Returns:
- a map of invalid properties. Will never be null.
-
validateProp
public void validateProp(String key, String value)
Validates a property. Throws an exception if validation fails.- Parameters:
key
- the attribute name to validate.value
- the attribute value to validate.- Throws:
jakarta.validation.ValidationException
- if validation fails.
-
getLoggingFile
public File getLoggingFile() throws IOException
Returns logging file to be monitor during server is running.- Specified by:
getLoggingFile
in interfaceLogManager
- Throws:
IOException
-
postConstruct
public void postConstruct()
Initialize the loggers- Specified by:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
listenToChangesOnloggingPropsFile
public void listenToChangesOnloggingPropsFile(File loggingPropertiesFile, LogManager logMgr)
-
generateAttributeChangeEvent
public void generateAttributeChangeEvent(String property, String propertyDetail, Map props)
-
addHandler
public void addHandler(Handler handler)
Description copied from interface:LogManager
Adds a new handler to the root logger- Specified by:
addHandler
in interfaceLogManager
- Parameters:
handler
- handler to be iadded.
-
preDestroy
public void preDestroy()
- Specified by:
preDestroy
in interfaceorg.glassfish.hk2.api.PreDestroy
-
getErrStream
public PrintStream getErrStream()
- Specified by:
getErrStream
in interfaceLogManager
-
getOutStream
public PrintStream getOutStream()
- Specified by:
getOutStream
in interfaceLogManager
-
-