Class DefaultJsonLogEnhancer

  • All Implemented Interfaces:
    JsonLogEnhancer

    public class DefaultJsonLogEnhancer
    extends java.lang.Object
    implements JsonLogEnhancer
    This is the basic support across logging vendors for mapping json objects to the right constructs and adding in extra basic info.
    Author:
    Richard Vowles - https://plus.google.com/+RichardVowles
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void failed​(java.util.Map<java.lang.String,​java.lang.String> context, java.util.Map<java.lang.String,​java.lang.Object> log, java.util.List<java.lang.String> alreadyEncodedJsonObjects, java.lang.Throwable e)  
      int getMapPriority()  
      void map​(java.util.Map<java.lang.String,​java.lang.String> context, java.util.Map<java.lang.String,​java.lang.Object> log, java.util.List<java.lang.String> alreadyEncodedJsonObjects)
      translates information from the context into the log.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultJsonLogEnhancer

        public DefaultJsonLogEnhancer()
    • Method Detail

      • map

        public void map​(java.util.Map<java.lang.String,​java.lang.String> context,
                        java.util.Map<java.lang.String,​java.lang.Object> log,
                        java.util.List<java.lang.String> alreadyEncodedJsonObjects)
        Description copied from interface: JsonLogEnhancer
        translates information from the context into the log. Each subsystem that stores data in the context should know how to map it to the log. Generic ones are provided (json: for example)
        Specified by:
        map in interface JsonLogEnhancer
        Parameters:
        context - - the original context (from ConnectContext) - items should be removed as they are consumed
        log - - the json object being logged out - this is a Map
        alreadyEncodedJsonObjects - - json objects that are already encoded and need to be preserved
      • failed

        public void failed​(java.util.Map<java.lang.String,​java.lang.String> context,
                           java.util.Map<java.lang.String,​java.lang.Object> log,
                           java.util.List<java.lang.String> alreadyEncodedJsonObjects,
                           java.lang.Throwable e)
        Specified by:
        failed in interface JsonLogEnhancer