Class Logging


  • public class Logging
    extends java.lang.Object
    Assistance class to use when logging. For chaincode/contract implementations please use java.util.logging or your own framework. All the Hyperledger Fabric code here is logged in loggers with names starting org.hyperledger Control of this is via the environment variables 'CORE_CHAINCODE_LOGGING_LEVEL' this takes a string that matches the following Java.util.logging levels (case insensitive) CRITICAL, ERROR -> Level.SEVERE, WARNING -> Level.WARNING, INFO -> Level.INFO NOTICE -> Level.CONFIG, DEBUG -> Level.FINEST
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PERFLOGGER  
    • Constructor Summary

      Constructors 
      Constructor Description
      Logging()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatError​(java.lang.Throwable throwable)
      Formats a Throwable to a string with details of all the causes as well
      static void setLogLevel​(java.lang.String newLevel)
      Sets the log level to the the
      • Methods inherited from class java.lang.Object

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

      • Logging

        public Logging()
    • Method Detail

      • formatError

        public static java.lang.String formatError​(java.lang.Throwable throwable)
        Formats a Throwable to a string with details of all the causes as well
        Parameters:
        throwable - Exception
        Returns:
        String formatted with all the details
      • setLogLevel

        public static void setLogLevel​(java.lang.String newLevel)
        Sets the log level to the the