Package org.swisspush.gateleen.logging
Class LoggingResource
- java.lang.Object
-
- org.swisspush.gateleen.logging.LoggingResource
-
public class LoggingResource extends Object
Class representing the json logging resource- Author:
- https://github.com/mcweba [Marc-Andre Weber]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLoggingResource.HeaderLogStrategyLogging strategy for the headers
-
Constructor Summary
Constructors Constructor Description LoggingResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFilterDestinations(Map<String,Map<String,String>> destinationEntries)Adds destination entries for the payloadFilter to the logging resources.voidaddHeaders(List<String> headers)Adds a list of header names to logvoidaddPayloadFilter(Map<String,String> payloadFilter)Adds a payloadfilter to the logging resourceMap<String,Map<String,String>>getDestinationEntries()Returns a map with destinationsLoggingResource.HeaderLogStrategygetHeaderLogStrategy()Returns the strategy for the headers logging.List<String>getHeaders()Returns a list of header names to log.List<Map<String,String>>getPayloadFilters()Returns a list of payload filtersvoidreset()Clears all logging resource values like payload filters and headersvoidsetHeaderLogStrategy(LoggingResource.HeaderLogStrategy headerLogStrategy)Set the strategy for the headers logging
-
-
-
Method Detail
-
getHeaderLogStrategy
public LoggingResource.HeaderLogStrategy getHeaderLogStrategy()
Returns the strategy for the headers logging. Default value isLoggingResource.HeaderLogStrategy.LOG_ALL- Returns:
- the current strategy for the headers logging
-
setHeaderLogStrategy
public void setHeaderLogStrategy(LoggingResource.HeaderLogStrategy headerLogStrategy)
Set the strategy for the headers logging- Parameters:
headerLogStrategy- HeaderLogStrategy enum
-
getHeaders
public List<String> getHeaders()
Returns a list of header names to log. Can be empty.- Returns:
- a list of header names to log
-
addHeaders
public void addHeaders(List<String> headers)
Adds a list of header names to log- Parameters:
headers- list of headers
-
getPayloadFilters
public final List<Map<String,String>> getPayloadFilters()
Returns a list of payload filters- Returns:
- list of payload filters
-
getDestinationEntries
public final Map<String,Map<String,String>> getDestinationEntries()
Returns a map with destinations- Returns:
- map with destinations
-
reset
public void reset()
Clears all logging resource values like payload filters and headers
-
addPayloadFilter
public void addPayloadFilter(Map<String,String> payloadFilter)
Adds a payloadfilter to the logging resource- Parameters:
payloadFilter- payloadFilter to add
-
-