<commit_before><?xml version="1.0"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.
-->

<document>
    <properties>
        <title>Frequently Asked Questions</title>
		<author email="<EMAIL>"><NAME></author>
    </properties>

    <body>
      <section name="Frequently Asked Questions">
      <ul>
      <li><a href="#which_jars">Which JAR files do I need?</a></li>
      <li><a href="#config_location">How do I specify the configuration file location?</a></li>
      <li><a href="#config_from_code">How do I configure log4j2 in code without a configuration file?</a></li>
      <li><a href="#config_sep_appender_level">How do I send log messages with different levels to different appenders?</a></li>
      <li><a href="#troubleshooting">How do I debug my configuration?</a></li>
      <li><a href="#separate_log_files">How do I dynamically write to separate log files?</a></li>
      <!--
      <li><a href="#custom_plugin">How do I get log4j2 to recognize my custom plugin?</a></li>
      -->
      </ul>
      <subsection>
		<a name="which_jars" />
        <h4>Which JAR files do I need?</h4>
        <p>You need at least the log4j-api-2.0 and the log4j-core-2.0 jar files.</p>
        <p>The other jars are necessary if your application calls the API
        of another logging framework and you want to route logging calls to the Log4j 2 implementation.</p>
        <p><img src="images/whichjar-2.1.png" alt="Diagram showing which JARs correspond to which systems" /></p>
        <p>You can use the log4j-to-slf4j adapter jar when your application calls the Log4j 2 API and you
        want to route logging calls to a SLF4J implementation.</p>
        <p><img src="images/whichjar-slf4j-2.1.png" alt="Diagram showing the dependency flow to use Log4j 2 API with SLF4J" /></p>
        <p>Some of the Log4j components have features with optional dependencies.
          The component page will have more detail.
          For example, the <a href="log4j-core/index.html">log4j-core component page</a>
          has an outline of which log4j-core features have external dependencies.</p>
        
		<a name="config_location" />
        <h4>How do I specify the configuration file location?</h4>
        <p>By default, Log4j looks for a configuration file named <b>log4j2.xml</b> (not log4j.xml) in the classpath.
        </p><p>
        You can also specify the full path of the configuration file with this system property:<br />
        <code>-Dlog4j.configurationFile=path/to/log4j2.xml</code></p>

		<a name="config_from_code" />
        <h4>How do I configure log4j2 in code without a configuration file?</h4>
        <p>You could use the static method <code>#initialize(String contextName, ClassLoader loader, String configLocation)</code>
         (see
         <a href="log4j-core/xref/org/apache/logging/log4j/core/config/Configurator.html">source code</a>)
          in <code>org.apache.logging.log4j.core.config.Configurator</code>.
         (You can pass null for the class loader.)
         Be aware that this class is not part of the public API so your code may break with any minor release.</p>
<commit_msg>Use version number 2.1 in body text.<commit_after><?xml version="1.0"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.
-->

<document>
    <properties>
        <title>Frequently Asked Questions</title>
		<author email="<EMAIL>"><NAME></author>
    </properties>

    <body>
      <section name="Frequently Asked Questions">
      <ul>
      <li><a href="#which_jars">Which JAR files do I need?</a></li>
      <li><a href="#config_location">How do I specify the configuration file location?</a></li>
      <li><a href="#config_from_code">How do I configure log4j2 in code without a configuration file?</a></li>
      <li><a href="#config_sep_appender_level">How do I send log messages with different levels to different appenders?</a></li>
      <li><a href="#troubleshooting">How do I debug my configuration?</a></li>
      <li><a href="#separate_log_files">How do I dynamically write to separate log files?</a></li>
      <!--
      <li><a href="#custom_plugin">How do I get log4j2 to recognize my custom plugin?</a></li>
      -->
      </ul>
      <subsection>
		<a name="which_jars" />
        <h4>Which JAR files do I need?</h4>
        <p>You need at least the log4j-api-2.1 and the log4j-core-2.1 jar files.</p>
        <p>The other jars are necessary if your application calls the API
        of another logging framework and you want to route logging calls to the Log4j 2 implementation.</p>
        <p><img src="images/whichjar-2.1.png" alt="Diagram showing which JARs correspond to which systems" /></p>
        <p>You can use the log4j-to-slf4j adapter jar when your application calls the Log4j 2 API and you
        want to route logging calls to a SLF4J implementation.</p>
        <p><img src="images/whichjar-slf4j-2.1.png" alt="Diagram showing the dependency flow to use Log4j 2 API with SLF4J" /></p>
        <p>Some of the Log4j components have features with optional dependencies.
          The component page will have more detail.
          For example, the <a href="log4j-core/index.html">log4j-core component page</a>
          has an outline of which log4j-core features have external dependencies.</p>
        
		<a name="config_location" />
        <h4>How do I specify the configuration file location?</h4>
        <p>By default, Log4j looks for a configuration file named <b>log4j2.xml</b> (not log4j.xml) in the classpath.
        </p><p>
        You can also specify the full path of the configuration file with this system property:<br />
        <code>-Dlog4j.configurationFile=path/to/log4j2.xml</code></p>

		<a name="config_from_code" />
        <h4>How do I configure log4j2 in code without a configuration file?</h4>
        <p>You could use the static method <code>#initialize(String contextName, ClassLoader loader, String configLocation)</code>
         (see
         <a href="log4j-core/xref/org/apache/logging/log4j/core/config/Configurator.html">source code</a>)
          in <code>org.apache.logging.log4j.core.config.Configurator</code>.
         (You can pass null for the class loader.)
         Be aware that this class is not part of the public API so your code may break with any minor release.</p>

{'fraction_non_alphanumeric': 0.1038328419433406, 'fraction_numerical': 0.013844378925778746, 'mean_word_length': 3.130227633668608, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 2, '>': 177, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5592410', 'n_tokens_mistral': 2260, 'n_tokens_neox': 2228, 'n_words': 872}