Package com.sun.common.util.logging
Interface LoggingConfig
-
- All Known Implementing Classes:
LoggingConfigImpl
@Contract public interface LoggingConfig
Handles I/O for a logging file.- Author:
- Naman Mehta
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
createZipFile(String sourceDir)
Creates a ZIP file from a given directory.Map<String,String>
deleteLoggingProperties(Map<String,String> props)
Deletes all properties from the provided list.String
getLoggingFileDetails()
Map<String,String>
getLoggingProperties()
Get all properties from the managed file.Map<String,String>
getLoggingProperties(boolean usePlaceholderReplacement)
Get all properties from the managed file.String
getLoggingProperty(String propertyName)
Gets a given property from the managed file.void
initialize(String target)
Initializes the configuration for a given target.Map<String,String>
setLoggingProperties(Map<String,String> props)
Sets all properties within the managed file.String
setLoggingProperty(String propertyName, String propertyValue)
Sets the given property within the managed file.
-
-
-
Method Detail
-
initialize
void initialize(String target) throws IOException
Initializes the configuration for a given target.- Parameters:
target
- the target to fetch the logs from.- Throws:
IOException
- if an error occurred while reading from the managed file.
-
getLoggingProperty
String getLoggingProperty(String propertyName) throws IOException
Gets a given property from the managed file.- Parameters:
propertyName
- the name of the property to get.- Returns:
- the value of the property, or null if it doesn't exist.
- Throws:
IOException
- if an error occurred while reading from the managed file.
-
getLoggingProperties
Map<String,String> getLoggingProperties() throws IOException
Get all properties from the managed file.- Returns:
- all properties contained within the managed file.
- Throws:
IOException
- if an error occurred while reading from the managed file.
-
getLoggingProperties
Map<String,String> getLoggingProperties(boolean usePlaceholderReplacement) throws IOException
Get all properties from the managed file.- Parameters:
usePlaceHolderReplacement
- whether to- Returns:
- all properties contained within the managed file.
- Throws:
IOException
- if an error occurred while reading from the managed file.
-
setLoggingProperty
String setLoggingProperty(String propertyName, String propertyValue) throws IOException
Sets the given property within the managed file.- Parameters:
propertyName
- the name of the property to set.propertyValue
- the value of the property to set.- Returns:
- the property value in the file.
- Throws:
IOException
- if an error occurred while writing to the managed file.
-
setLoggingProperties
Map<String,String> setLoggingProperties(Map<String,String> props) throws IOException
Sets all properties within the managed file.- Returns:
- all properties to set within the managed file.
- Throws:
IOException
- if an error occurred while writing to the managed file.
-
deleteLoggingProperties
Map<String,String> deleteLoggingProperties(Map<String,String> props) throws IOException
Deletes all properties from the provided list.- Parameters:
props
- all properties to delete within the managed file.- Returns:
- the list of deleted properties.
- Throws:
IOException
- if an error occurred while writing to the managed file.
-
getLoggingFileDetails
String getLoggingFileDetails() throws IOException
- Returns:
- the file for the GFHandler to log to.
- Throws:
IOException
- if an error occurred while reading from the managed file.
-
createZipFile
String createZipFile(String sourceDir) throws IOException
Creates a ZIP file from a given directory.- Parameters:
sourceDir
- the directory to ZIP.- Throws:
IOException
- if an error occurred while creating the ZIP.
-
-