Package com.sun.common.util.logging
Class LoggingConfigImpl
java.lang.Object
com.sun.common.util.logging.LoggingConfigImpl
- All Implemented Interfaces:
LoggingConfig,org.glassfish.hk2.api.PostConstruct
@Service
@Contract
public class LoggingConfigImpl
extends Object
implements LoggingConfig, org.glassfish.hk2.api.PostConstruct
Implementation of Logging Commands
- Author:
- Naman Mehta
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateZipFile(String sourceDir) Creates zip file for given sourceDirectorycreateZipFile(String sourceDir, String zipFileName) deleteLoggingProperties(Collection<String> properties) Delete the properties from logging.properties file.deleteLoggingProperties(Collection<String> properties, String target) Delete the properties from logging.properties file.Return a logging file details in the logging.properties file.getLoggingFileDetails(String targetConfigName) getLoggingProperties(String targetConfigName) voidsetLoggingProperty(String propertyName, String propertyValue) setLoggingProperty() sets an existing propertyName to be propertyValue if the property doesn't exist the property will be added.setLoggingProperty(String propertyName, String propertyValue, String targetConfigName) setLoggingProperty() sets an existing propertyName to be propertyValue if the property doesn't exist the property will be added.voidsetupConfigDir(File file, File installDir) updateLoggingProperties(Map<String, String> properties) Update the properties to new values.updateLoggingProperties(Map<String, String> properties, String targetConfigName) Update the properties to new values for given target.
-
Constructor Details
-
LoggingConfigImpl
public LoggingConfigImpl()
-
-
Method Details
-
postConstruct
public void postConstruct()- Specified by:
postConstructin interfaceorg.glassfish.hk2.api.PostConstruct
-
setupConfigDir
-
setLoggingProperty
setLoggingProperty() sets an existing propertyName to be propertyValue if the property doesn't exist the property will be added. The logManager readConfiguration is not called in this method.- Specified by:
setLoggingPropertyin interfaceLoggingConfig- Parameters:
propertyName- Name of the property to setpropertyValue- Value to set- Throws:
IOException
-
setLoggingProperty
public String setLoggingProperty(String propertyName, String propertyValue, String targetConfigName) throws IOException setLoggingProperty() sets an existing propertyName to be propertyValue if the property doesn't exist the property will be added. The logManager readConfiguration is not called in this method.- Specified by:
setLoggingPropertyin interfaceLoggingConfig- Parameters:
propertyName- Name of the property to setpropertyValue- Value to set- Throws:
IOException
-
updateLoggingProperties
Description copied from interface:LoggingConfigUpdate the properties to new values. properties is a Map of names of properties and their cooresponding value. If the property does not exist then it is added to the logging.properties file. The readConfiguration method is called on the logManager after updating the properties.- Specified by:
updateLoggingPropertiesin interfaceLoggingConfig- Throws:
IOException
-
updateLoggingProperties
public Map<String,String> updateLoggingProperties(Map<String, String> properties, String targetConfigName) throws IOExceptionDescription copied from interface:LoggingConfigUpdate the properties to new values for given target. properties is a Map of names of properties and their coresponding value. If the property does not exist then it is added to the logging.properties file.- Specified by:
updateLoggingPropertiesin interfaceLoggingConfig- Parameters:
properties- Map of the name and value of property to add or update- Throws:
IOException
-
getLoggingProperties
- Specified by:
getLoggingPropertiesin interfaceLoggingConfig- Returns:
- the properties and corresponding values in the logging.properties file for given target server.
- Throws:
IOException
-
getLoggingProperties
- Specified by:
getLoggingPropertiesin interfaceLoggingConfig- Returns:
- the properties and corresponding values in the logging.properties file.
- Throws:
IOException
-
deleteLoggingProperties
Description copied from interface:LoggingConfigDelete the properties from logging.properties file.- Specified by:
deleteLoggingPropertiesin interfaceLoggingConfig- Throws:
IOException
-
deleteLoggingProperties
public Map<String,String> deleteLoggingProperties(Collection<String> properties, String target) throws IOException Description copied from interface:LoggingConfigDelete the properties from logging.properties file.- Specified by:
deleteLoggingPropertiesin interfaceLoggingConfig- Throws:
IOException
-
createZipFile
Description copied from interface:LoggingConfigCreates zip file for given sourceDirectory- Specified by:
createZipFilein interfaceLoggingConfig- Throws:
IOException
-
createZipFile
- Throws:
IOException
-
getLoggingFileDetails
Return a logging file details in the logging.properties file.- Throws:
IOException
-
getLoggingFileDetails
- Returns:
- a logging file details in the logging.properties file for given target.
- Throws:
IOException
-
getDefaultLoggingProperties
- Returns:
- a Map of all the properties and corresponding values from the logging.properties file from template..
- Throws:
IOException
-