0

In my project logging is working perfectly fine. Using Slf4j for logging. Sample is as follows:

 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 public class MyClass{
   private static Logger logger = LoggerFactory.getLogger(MyClass.class);

   public static void main(String...args){
     logger.error("error log...");
   }
 }

we have used log4j2.xml for logging configuration. Now my requirement is to make a custom level log "VERBOSE" having int value 150. I am trying hard but it seems difficult or I dont know if slf4j has flexibility to provide the custom level logging. Please assist.

Mark
  • 17
  • 9

1 Answers1

1

The Log4j2 API has that capability. SLF4J does not. However, while not equivalent, you could add a VERBOSE Marker to the events and filter on that.

rgoers
  • 8,696
  • 1
  • 22
  • 24
  • thank you @rgoers for replying and confirming as I was also in doubt whether SLF4J has the capability to do the same. – Mark Feb 20 '20 at 13:11