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) Creating zip file for given log filescreateZipFile(String sourceDir, String zipFileName) Creating zip file for given log filesdeleteLoggingProperties(Collection<String> properties) Delete the properties from logging.properties file.deleteLoggingProperties(Collection<String> properties, String target) Delete the properties from logging.properties file.getLoggingFileDetails(String targetConfigName) Return a Map of all the properties and corresponding values in the logging.properties file.getLoggingProperties(String targetConfigName) Return a Map of all the properties and corresponding values in the logging.properties file for given target.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. properties is a Map of names of properties and their coresponding value.
-
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- If an I/O error occurs
-
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- If an I/O error occurs
-
updateLoggingProperties
update the properties to new values. properties is a Map of names of properties and their corresponding 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- If an I/O error occurs
-
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
Return a Map of all the properties and corresponding values in the logging.properties file for given target.- Specified by:
getLoggingPropertiesin interfaceLoggingConfig- Parameters:
targetConfigName- Target config name- Returns:
- the properties and corresponding values in the logging.properties file for given target server.
- Throws:
IOException- If an I/O error occurs
-
getLoggingProperties
Return a Map of all the properties and corresponding values in the logging.properties file.- Specified by:
getLoggingPropertiesin interfaceLoggingConfig- Returns:
- the properties and corresponding values in the logging.properties file.
- Throws:
IOException- If an I/O error occurs
-
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
Creating zip file for given log files- Specified by:
createZipFilein interfaceLoggingConfig- Parameters:
sourceDir- Source directory from which needs to create zip- Throws:
IOException- if an I/O error occurs
-
createZipFile
Creating zip file for given log files- Parameters:
sourceDir- Source directory from which needs to create zipzipFileName- zip file name which need to be created- Throws:
IOException- If an I/O error occurs
-
getLoggingFileDetails
- Returns:
- a logging file path from the logging.properties file.
- Throws:
IOException- If an I/O error occurs
-
getLoggingFileDetails
- Returns:
- a logging file path in the logging.properties file for given target.
- Throws:
IOException- If an I/O error occurs
-
getDefaultLoggingProperties
- Returns:
- a Map of all the properties and corresponding values from the logging.properties file from template.
- Throws:
IOException- If an I/O error occurs
-