I have a somewhat confusing problem but I will try to explain, I am working on a project that is using some external libraries, and I would like to implement a log, I have already seen that in the external packages they use the SLF4J package. So I did a project to test component settings to write to a file and it was all going fine until I tried for SLF4J in the project I'm working on, because when I set up log4j in the project it apparently activated all the calls from the external libraries and started to show everything in the console, being that it did not record anything in the log file, apparently it ignores the configuration file, but at the same time this is not true because when the shot everything stops.
The project is a console and does not use mavem because of network configuration problems here at work. What I want is for him to write the log to the file and preferably without the information from the external libraries, but if it is not possible, everything can log everything. Below is the log4j.xml file with the sensitive information changed.
>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<param name="threshold" value="DEBUG" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %c{1} - %m%n"/>
</layout>
</appender>
<appender name="file" class="org.apache.log4j.FileAppender">
<param name="file" value="d:/temp/app.log" />
<param name="append" value="true" />
<param name="threshold" value="WARN" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] - %m%n" />
</layout>
</appender>
<root>
<priority value ="debug" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</log4j:configuration>