Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to disable log4j in 3rd party jar?
    text
    copied!<p>I'm experimenting writing a java SE swing application using JBoss weld. Weld configures logging with log4j using the following log4j.xml file in the jar:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt; &lt;!-- JBoss, Home of Professional Open Source Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors by the @authors tag. See the copyright.txt in the distribution for a full listing of individual contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --&gt; &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"&gt; &lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt; &lt;param name="Target" value="System.out"/&gt; &lt;layout class="org.apache.log4j.PatternLayout"&gt; &lt;!-- The default pattern: Date Priority [Category] Message\n --&gt; &lt;param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{2}] %m%n"/&gt; &lt;/layout&gt; &lt;filter class="org.apache.log4j.varia.StringMatchFilter"&gt; &lt;param name="AcceptOnMatch" value="false" /&gt; &lt;param name="StringToMatch" value="Failure while notifying an observer of event [a]" /&gt; &lt;/filter&gt; &lt;/appender&gt; &lt;!-- ############### Weld logging ################### --&gt; &lt;category name="org.jboss.weld"&gt; &lt;priority value="INFO"/&gt; &lt;/category&gt; &lt;root&gt; &lt;priority value="INFO"/&gt; &lt;appender-ref ref="CONSOLE"/&gt; &lt;/root&gt; &lt;/log4j:configuration&gt; </code></pre> <p>I want to disable logging altogether in my application. I tried to disable it providing a log4j.properties file as follows:</p> <pre><code>log4j.debug=FALSE log4j.rootLogger=OFF, CONSOLE </code></pre> <p>No matter what I try to do I cannot prevent the log4j messages from Weld to show up in the console. All I want to do is completely disable logging. But How?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload