2525import java .util .ArrayList ;
2626import java .util .List ;
2727
28+ import org .apache .maven .api .Constants ;
2829import org .apache .maven .api .MonotonicClock ;
2930import org .slf4j .Logger ;
3031import org .slf4j .Marker ;
4344 *
4445 *
4546 * <ul>
46- * <li><code>org.slf4j.simpleLogger .logFile</code> - The output target which can
47+ * <li><code>maven.logger .logFile</code> - The output target which can
4748 * be the <em>path</em> to a file, or the special values "System.out" and
4849 * "System.err". Default is "System.err".</li>
4950 *
50- * <li><code>org.slf4j.simpleLogger .cacheOutputStream</code> - If the output
51+ * <li><code>maven.logger .cacheOutputStream</code> - If the output
5152 * target is set to "System.out" or "System.err" (see preceding entry), by
5253 * default, logs will be output to the latest value referenced by
5354 * <code>System.out/err</code> variables. By setting this parameter to true, the
5455 * output stream will be cached, i.e. assigned once at initialization time and
5556 * re-used independently of the current value referenced by
5657 * <code>System.out/err</code>.</li>
5758 *
58- * <li><code>org.slf4j.simpleLogger .defaultLogLevel</code> - Default log level
59+ * <li><code>maven.logger .defaultLogLevel</code> - Default log level
5960 * for all instances of SimpleLogger. Must be one of ("trace", "debug", "info",
6061 * "warn", "error" or "off"). If not specified, defaults to "info".</li>
6162 *
62- * <li><code>org.slf4j.simpleLogger .log.<em>a.b.c</em></code> - Logging detail
63+ * <li><code>maven.logger .log.<em>a.b.c</em></code> - Logging detail
6364 * level for a SimpleLogger instance named "a.b.c". Right-side value must be one
6465 * of "trace", "debug", "info", "warn", "error" or "off". When a SimpleLogger
6566 * named "a.b.c" is initialized, its level is assigned from this property. If
6667 * unspecified, the level of nearest parent logger will be used, and if none is
6768 * set, then the value specified by
68- * <code>org.slf4j.simpleLogger .defaultLogLevel</code> will be used.</li>
69+ * <code>maven.logger .defaultLogLevel</code> will be used.</li>
6970 *
70- * <li><code>org.slf4j.simpleLogger .showDateTime</code> - Set to
71+ * <li><code>maven.logger .showDateTime</code> - Set to
7172 * <code>true</code> if you want the current date and time to be included in
7273 * output messages. Default is <code>false</code></li>
7374 *
74- * <li><code>org.slf4j.simpleLogger .dateTimeFormat</code> - The date and time
75+ * <li><code>maven.logger .dateTimeFormat</code> - The date and time
7576 * format to be used in the output messages. The pattern describing the date and
7677 * time format is defined by <a href=
7778 * "http://docs.oracle.com/javase/1.5.0/docs/api/java/text/SimpleDateFormat.html">
7879 * <code>SimpleDateFormat</code></a>. If the format is not specified or is
7980 * invalid, the number of milliseconds since start up will be output.</li>
8081 *
81- * <li><code>org.slf4j.simpleLogger .showThreadName</code> -Set to
82+ * <li><code>maven.logger .showThreadName</code> -Set to
8283 * <code>true</code> if you want to output the current thread name. Defaults to
8384 * <code>true</code>.</li>
8485 *
85- * <li>(since version 1.7.33 and 2.0.0-alpha6) <code>org.slf4j.simpleLogger .showThreadId</code> -
86+ * <li>(since version 1.7.33 and 2.0.0-alpha6) <code>maven.logger .showThreadId</code> -
8687 * If you would like to output the current thread id, then set to
8788 * <code>true</code>. Defaults to <code>false</code>.</li>
8889 *
89- * <li><code>org.slf4j.simpleLogger .showLogName</code> - Set to
90+ * <li><code>maven.logger .showLogName</code> - Set to
9091 * <code>true</code> if you want the Logger instance name to be included in
9192 * output messages. Defaults to <code>true</code>.</li>
9293 *
93- * <li><code>org.slf4j.simpleLogger .showShortLogName</code> - Set to
94+ * <li><code>maven.logger .showShortLogName</code> - Set to
9495 * <code>true</code> if you want the last component of the name to be included
9596 * in output messages. Defaults to <code>false</code>.</li>
9697 *
97- * <li><code>org.slf4j.simpleLogger .levelInBrackets</code> - Should the level
98+ * <li><code>maven.logger .levelInBrackets</code> - Should the level
9899 * string be output in brackets? Defaults to <code>false</code>.</li>
99100 *
100- * <li><code>org.slf4j.simpleLogger .warnLevelString</code> - The string value
101+ * <li><code>maven.logger .warnLevelString</code> - The string value
101102 * output for the warn level. Defaults to <code>WARN</code>.</li>
102103 *
103104 * </ul>
@@ -184,34 +185,9 @@ static void init() {
184185 private transient String shortLogName = null ;
185186
186187 /**
187- * All system properties used by <code>SimpleLogger</code> start with this
188- * prefix
188+ * Legacy SLF4J prefix maintained for backwards compatibility
189189 */
190- public static final String SYSTEM_PREFIX = "org.slf4j.simpleLogger." ;
191-
192- public static final String LOG_KEY_PREFIX = MavenBaseLogger .SYSTEM_PREFIX + "log." ;
193-
194- public static final String CACHE_OUTPUT_STREAM_STRING_KEY = MavenBaseLogger .SYSTEM_PREFIX + "cacheOutputStream" ;
195-
196- public static final String WARN_LEVEL_STRING_KEY = MavenBaseLogger .SYSTEM_PREFIX + "warnLevelString" ;
197-
198- public static final String LEVEL_IN_BRACKETS_KEY = MavenBaseLogger .SYSTEM_PREFIX + "levelInBrackets" ;
199-
200- public static final String LOG_FILE_KEY = MavenBaseLogger .SYSTEM_PREFIX + "logFile" ;
201-
202- public static final String SHOW_SHORT_LOG_NAME_KEY = MavenBaseLogger .SYSTEM_PREFIX + "showShortLogName" ;
203-
204- public static final String SHOW_LOG_NAME_KEY = MavenBaseLogger .SYSTEM_PREFIX + "showLogName" ;
205-
206- public static final String SHOW_THREAD_NAME_KEY = MavenBaseLogger .SYSTEM_PREFIX + "showThreadName" ;
207-
208- public static final String SHOW_THREAD_ID_KEY = MavenBaseLogger .SYSTEM_PREFIX + "showThreadId" ;
209-
210- public static final String DATE_TIME_FORMAT_KEY = MavenBaseLogger .SYSTEM_PREFIX + "dateTimeFormat" ;
211-
212- public static final String SHOW_DATE_TIME_KEY = MavenBaseLogger .SYSTEM_PREFIX + "showDateTime" ;
213-
214- public static final String DEFAULT_LOG_LEVEL_KEY = MavenBaseLogger .SYSTEM_PREFIX + "defaultLogLevel" ;
190+ public static final String LEGACY_PREFIX = "org.slf4j.simpleLogger." ;
215191
216192 /**
217193 * Protected access allows only {@link MavenLoggerFactory} and also derived classes to instantiate
@@ -234,8 +210,8 @@ String recursivelyComputeLevelString() {
234210 int indexOfLastDot = tempName .length ();
235211 while ((levelString == null ) && (indexOfLastDot > -1 )) {
236212 tempName = tempName .substring (0 , indexOfLastDot );
237- levelString = CONFIG_PARAMS .getStringProperty (MavenBaseLogger . LOG_KEY_PREFIX + tempName , null );
238- indexOfLastDot = String . valueOf ( tempName ) .lastIndexOf ("." );
213+ levelString = CONFIG_PARAMS .getStringProperty (Constants . MAVEN_LOGGER_LOG_PREFIX + tempName , null );
214+ indexOfLastDot = tempName .lastIndexOf ("." );
239215 }
240216 return levelString ;
241217 }
@@ -244,8 +220,8 @@ String recursivelyComputeLevelString() {
244220 * To avoid intermingling of log messages and associated stack traces, the two
245221 * operations are done in a synchronized block.
246222 *
247- * @param buf
248- * @param t
223+ * @param buf The StringBuilder containing the log message to be written
224+ * @param t The Throwable object whose stack trace should be written, may be null
249225 */
250226 protected void write (StringBuilder buf , Throwable t ) {
251227 PrintStream targetStream = CONFIG_PARAMS .outputChoice .getTargetPrintStream ();
0 commit comments