Skip to content

Commit ec5e1ce

Browse files
committed
update logging documentation
1 parent bd71dd7 commit ec5e1ce

File tree

2 files changed

+42
-12
lines changed

2 files changed

+42
-12
lines changed

maven-embedder/src/site/apt/logging.apt

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
Maven Logging
2727

28-
End-user logging documentation is available {{{/maven-logging.html}in Maven site}}.
28+
{{{/maven-logging.html}End-user logging documentation}} is available {{{/maven-logging.html}in Maven site}}.
2929
This documentation is focused on internal implementation details.
3030

3131
* Logging API
@@ -48,7 +48,7 @@ Maven Logging
4848

4949
* Logging Implementation
5050

51-
Maven 3.1.0 ships bundled with {{{http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html}SLF4J simple logger}},
51+
Maven 3.1.0 ships bundled with {{{https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html}SLF4J simple logger}} and since 3.5.0 {{{../maven-slf4j-provider/}Maven-customized <<<maven-slf4j-provider>>>}},
5252
but is ready to use other logging implementations: SLF4J is responsible for loading the implementation, referred to as
5353
{{{http://www.slf4j.org/manual.html#swapping}"SLF4J bindings"}}.
5454

@@ -62,6 +62,8 @@ Maven Logging
6262
{{{./apidocs/org/apache/maven/cli/logging/Slf4jConfigurationFactory.html}Slf4jConfigurationFactory}} /
6363
{{{./apidocs/org/apache/maven/cli/logging/Slf4jConfiguration.html}Slf4jConfiguration}}.
6464

65+
~~ TODO document META-INF/maven/slf4j-configuration.properties
66+
6567
* Getting Logger Instance
6668

6769
Starting with Maven 3.1.0, SLF4J Logger can be used directly. This technique can be used safely in Maven core
@@ -79,14 +81,7 @@ public class MyClass
7981

8082
* Logger Name
8183

82-
Before Maven 3.1.0, with logging implementation done in Maven, logger name wasn't used by basic console logging implementation:
83-
they are as-is, without clear convention on when to pass logger from class to class or when to create a new logger.
84-
85-
Starting with Maven 3.1.0, logging implementation can be of greatest use if logger names are well defined. This definition still
86-
needs to be defined and implemented:
87-
88-
* classical "class name" pattern?
89-
90-
* Maven-specific name hierarchy?
84+
Logger name is basically the classical fully qualified class name: it's not visible by default, but can be activated (see {{{/maven-logging.html}user documentation}}).
9185

92-
* a mix (some with class name, some with Maven-specific hierarchy)?
86+
Notice that before Maven 3.1.0, with logger created by Maven, some code used to pass logger from class to class because it could not create a new logger:
87+
discrepencies between logger name and actual class may happen.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
~~ Licensed to the Apache Software Foundation (ASF) under one
2+
~~ or more contributor license agreements. See the NOTICE file
3+
~~ distributed with this work for additional information
4+
~~ regarding copyright ownership. The ASF licenses this file
5+
~~ to you under the Apache License, Version 2.0 (the
6+
~~ "License"); you may not use this file except in compliance
7+
~~ with the License. You may obtain a copy of the License at
8+
~~
9+
~~ http://www.apache.org/licenses/LICENSE-2.0
10+
~~
11+
~~ Unless required by applicable law or agreed to in writing,
12+
~~ software distributed under the License is distributed on an
13+
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
~~ KIND, either express or implied. See the License for the
15+
~~ specific language governing permissions and limitations
16+
~~ under the License.
17+
18+
-----
19+
About
20+
-----
21+
Hervé Boutemy
22+
-----
23+
2023-06-19
24+
-----
25+
26+
Maven SLF4J Provider
27+
28+
An extension to {{{https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html}SLF4J Simple}} to add enhanced color support.
29+
30+
Color is managed by <<<MavenSimpleLogger>>>, created by <<<MavenSimpleLoggerFactory>>>, and injected by <<<StaticLoggerBinder>>>: everything else is
31+
copied at build time from {{{https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html}SLF4J Simple}}
32+
33+
* See Also
34+
35+
* {{{../maven-embedder/logging.html}Maven Logging}}

0 commit comments

Comments
 (0)