Search code examples
javaffmpeg

How to disable slf4j log in java


Sorry for my poor English.

I'm using ffmpeg-cli-wrapper library in java

[main] INFO net.bramp.ffmpeg.RunProcessFunction - .\ffprobe.exe -version

[main] INFO net.bramp.ffmpeg.RunProcessFunction - .\ffprobe.exe -v quiet -print_format json -show_error -show_format -show_streams -show_chapters

How to remove this log?

try this:

  1. java.util.logging.Logger.getLogger("net.bramp.ffmpeg").setLevel(Level.OFF);

  2. /logger name="net.bramp.ffmpeg" level="OFF"/ in logback.xml

but not work...

RunProcessFunction src: https://github.com/bramp/ffmpeg-cli-wrapper/blob/master/src/main/java/net/bramp/ffmpeg/RunProcessFunction.java


Solution

  • According to the library's pom.xml, I see that ffmpeg-cli-wrapper uses logback 1.2.11. I would try to add a logback.xml basic configuration file to your project, and configure disabling the logger for that lib/class there. See this question, which has an example of a logback.xml config file, with answer that disables log for a specific class of exception.