<commit_before>[[spring-jcl]]
= Logging

Spring Framework since 5.0 comes with its own Commons Logging bridge implemented
in `spring-jcl` module. The implementation checks for the presence of the Log4j 2.x API
and the SLF4J 1.7 API in the Spring Framework classpath, falling back to JUL if none of
the two is available. Note that this Commons Logging variant is only meant to be used
for infrastructure logging purposes in the core framework and in extensions.

[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
public class MyBean {
	private final Log log = LogFactory.getLog(getClass());
    // ...
}
----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
class MyBean {
  private val log = LogFactory.getLog(javaClass)
  // ...
}
----

Log implementation may be instantiated by `org.apache.commons.logging.LogFactory`.

For logging need in application code, prefer direct use of Log4j 2.x or SLF4J or JUL.
Simply put Log4j 2.x or Logback (or another SLF4J provider) onto your classpath, without
any extra bridges, and let the framework auto-adapt to your choice. For further information see
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-logging[Spring Boot Logging Reference Documentation].
<commit_msg>Polish spring-jcl documentation<commit_after>[[spring-jcl]]
= Logging

Since Spring Framework 5.0, Spring comes with its own Commons Logging bridge implemented
in the `spring-jcl` module. The implementation checks for the presence of the Log4j 2.x
API and the SLF4J 1.7 API in the classpath and uses the first one of those found as the
logging implementation, falling back to the Java platform's core logging facilities (also
known as _JUL_ or `java.util.logging`) if neither Log4j 2.x nor SLF4J is available.

Put Log4j 2.x or Logback (or another SLF4J provider) in your classpath, without any extra
bridges, and let the framework auto-adapt to your choice. For further information see the
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-logging[Spring
Boot Logging Reference Documentation].

[NOTE]
====
Spring's Commons Logging variant is only meant to be used for infrastructure logging
purposes in the core framework and in extensions.

For logging needs within application code, prefer direct use of Log4j 2.x, SLF4J, or JUL.
====

A `Log` implementation may be retrieved via `org.apache.commons.logging.LogFactory` as in
the following example.

[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
public class MyBean {
	private final Log log = LogFactory.getLog(getClass());
    // ...
}
----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
class MyBean {
  private val log = LogFactory.getLog(javaClass)
  // ...
}
----

{'fraction_non_alphanumeric': 0.09793447293447294, 'fraction_numerical': 0.011752136752136752, 'mean_word_length': 4.475633528265107, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5281155', 'n_tokens_mistral': 838, 'n_tokens_neox': 811, 'n_words': 324}