From b5c545e8ca75b736005e8085a6e0da81f9a1c1cd Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Mon, 24 Jul 2023 13:39:02 +0200 Subject: [PATCH] Logging configuration stylistic review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michal Maléř --- .../logging/CategoryBuildTimeConfig.java | 10 ++++----- .../runtime/logging/CategoryConfig.java | 4 ++-- .../runtime/logging/CleanupFilterConfig.java | 4 ++-- .../runtime/logging/ConsoleConfig.java | 22 +++++++++---------- .../quarkus/runtime/logging/FileConfig.java | 6 ++--- .../runtime/logging/LogBuildTimeConfig.java | 6 ++--- .../io/quarkus/runtime/logging/LogConfig.java | 10 ++++----- .../quarkus/runtime/logging/SyslogConfig.java | 10 ++++----- .../logging/json/runtime/JsonLogConfig.java | 10 ++++----- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryBuildTimeConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryBuildTimeConfig.java index 81228549b2bc7..c05383d6e7c4b 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryBuildTimeConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryBuildTimeConfig.java @@ -8,12 +8,12 @@ public class CategoryBuildTimeConfig { /** * The minimum log level for this category. * By default, all categories are configured with DEBUG minimum level. - * - * To get runtime logging below DEBUG, e.g. TRACE, - * the minimum level has to be adjusted at build time, the right log level needs to be provided at runtime. - * + *

+ * To get runtime logging below DEBUG, e.g., TRACE, + * adjust the minimum level at build time. The right log level needs to be provided at runtime. + *

* As an example, to get TRACE logging, - * minimum level needs to be at TRACE and the runtime log level needs to match that. + * minimum level needs to be at TRACE, and the runtime log level needs to match that. */ @ConfigItem(defaultValue = "inherit") public InheritableLevel minLevel; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryConfig.java index f886deca2a912..560f5420b7e92 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/CategoryConfig.java @@ -11,9 +11,9 @@ public class CategoryConfig { /** * The log level for this category. - * + *

* Note that to get log levels below INFO, - * the minimum level build time configuration option needs to be adjusted as well. + * the minimum level build-time configuration option also needs to be adjusted. */ @ConfigItem(defaultValue = "inherit") InheritableLevel level; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/CleanupFilterConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/CleanupFilterConfig.java index ad56bdf5320a6..a2e0656cf9444 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/CleanupFilterConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/CleanupFilterConfig.java @@ -9,13 +9,13 @@ @ConfigGroup public class CleanupFilterConfig { /** - * The message starts to match + * The message prefix to match */ @ConfigItem(defaultValue = "inherit") public List ifStartsWith; /** - * The new log level for the filtered message, defaults to DEBUG + * The new log level for the filtered message. Defaults to DEBUG. */ @ConfigItem(defaultValue = "DEBUG") public Level targetLevel; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java index a9773156dfb72..f919912faca2d 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java @@ -22,8 +22,8 @@ public class ConsoleConfig { boolean stderr; /** - * The log format. Note that this value will be ignored if an extension is present that takes - * control of console formatting (e.g. an XML or JSON-format extension). + * The log format. Note that this value is ignored if an extension is present that takes + * control of console formatting (e.g., an XML or JSON-format extension). */ @ConfigItem(defaultValue = "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n") String format; @@ -35,13 +35,13 @@ public class ConsoleConfig { Level level; /** - * If the console logging should be in color. If undefined quarkus takes - * best guess based on operating system and environment. - * Note that this value will be ignored if an extension is present that takes - * control of console formatting (e.g. an XML or JSON-format extension). - * - * This has been deprecated, and replaced with quarkus.console.color instead, - * as quarkus now provides more console based functionality than just logging. + * If the console logging should be in color. If undefined, Quarkus takes + * best guess based on the operating system and environment. + * Note that this value is ignored if an extension is present that takes + * control of console formatting (e.g., an XML or JSON-format extension). + *

+ * This has been deprecated and replaced with quarkus.console.color, + * as Quarkus now provides more console-based functionality than just logging. */ @ConfigItem @Deprecated @@ -49,8 +49,8 @@ public class ConsoleConfig { /** * Specify how much the colors should be darkened. - * Note that this value will be ignored if an extension is present that takes - * control of console formatting (e.g. an XML or JSON-format extension). + * Note that this value is ignored if an extension is present that takes + * control of console formatting (e.g., an XML or JSON-format extension). */ @ConfigItem(defaultValue = "0") int darken; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java index 48de1c40e3925..0116f71d90574 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java @@ -62,14 +62,14 @@ public class FileConfig { * File rotation config. * The time interval is determined by the content of the fileSuffix property. * The size interval is determined by the content of the maxFileSize property. - * If both are used, the rotating will be based on time then size. + * If both are used, the rotating will be based on time, then on size. */ RotationConfig rotation; @ConfigGroup public static class RotationConfig { /** - * The maximum file size of the log file after which a rotation is executed. + * The maximum log file size, after which a rotation is executed. */ @ConfigItem(defaultValue = "10M") MemorySize maxFileSize; @@ -81,7 +81,7 @@ public static class RotationConfig { int maxBackupIndex; /** - * File handler rotation file suffix. + * The file handler rotation file suffix. * When used, the file will be rotated based on its suffix. * * Example fileSuffix: .yyyy-MM-dd diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/LogBuildTimeConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/LogBuildTimeConfig.java index 2f52113e41f51..0f9914985fccf 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/LogBuildTimeConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/LogBuildTimeConfig.java @@ -12,7 +12,7 @@ public class LogBuildTimeConfig { /** - * Whether logging metrics are published in case a metrics extension is present. + * If enabled and a metrics extension is present, logging metrics are published. */ @ConfigItem(name = "metrics.enabled", defaultValue = "false") public boolean metricsEnabled; @@ -26,8 +26,8 @@ public class LogBuildTimeConfig { /** * Minimum logging categories. *

- * Logging is done on a per-category basis. Each category can be independently configured. - * A configuration which applies to a category will also apply to all sub-categories of that category, + * Logging is done on a per-category basis. Each category can be configured independently. + * A configuration that applies to a category will also apply to all sub-categories of that category, * unless there is a more specific matching sub-category configuration. */ @ConfigItem(name = "category") diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/LogConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/LogConfig.java index 95029f7c82be2..6efcb787d1960 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/LogConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/LogConfig.java @@ -19,7 +19,7 @@ public final class LogConfig { /** * The log level of the root category, which is used as the default log level for all categories. * - * JBoss Logging supports Apache style log levels: + * JBoss Logging supports Apache-style log levels: * * * {@link org.jboss.logmanager.Level#FATAL} * * {@link org.jboss.logmanager.Level#ERROR} @@ -63,7 +63,7 @@ public final class LogConfig { * Logging categories. *

* Logging is done on a per-category basis. Each category can be independently configured. - * A configuration which applies to a category will also apply to all sub-categories of that category, + * A configuration that applies to a category will also apply to all sub-categories of that category, * unless there is a more specific matching sub-category configuration. */ @ConfigItem(name = "category") @@ -82,7 +82,7 @@ public final class LogConfig { /** * File handlers. *

- * The named file handlers configured here can be linked on one or more categories. + * The named file handlers configured here can be linked to one or more categories. */ @ConfigItem(name = "handler.file") @ConfigDocSection @@ -91,7 +91,7 @@ public final class LogConfig { /** * Syslog handlers. *

- * The named syslog handlers configured here can be linked on one or more categories. + * The named syslog handlers configured here can be linked to one or more categories. */ @ConfigItem(name = "handler.syslog") @ConfigDocSection @@ -106,7 +106,7 @@ public final class LogConfig { /** * The names of additional handlers to link to the root category. - * These handlers are defined in consoleHandlers, fileHandlers or syslogHandlers. + * These handlers are defined in consoleHandlers, fileHandlers, or syslogHandlers. */ @ConfigItem Optional> handlers; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/SyslogConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/SyslogConfig.java index f0c64fc80f06f..0411d345fdcc3 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/SyslogConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/SyslogConfig.java @@ -22,7 +22,7 @@ public class SyslogConfig { /** * - * The IP address and port of the syslog server + * The IP address and port of the Syslog server */ @ConfigItem(defaultValue = "localhost:514") InetSocketAddress endpoint; @@ -52,19 +52,19 @@ public class SyslogConfig { SyslogType syslogType; /** - * Sets the protocol used to connect to the syslog server + * Sets the protocol used to connect to the Syslog server */ @ConfigItem(defaultValue = "tcp") Protocol protocol; /** - * Set to {@code true} if the message being sent should be prefixed with the size of the message + * If enabled, the message being sent is prefixed with the size of the message */ @ConfigItem boolean useCountingFraming; /** - * Set to {@code true} if the message should be truncated + * Set to {@code true} to truncate the message if it exceeds maximum length */ @ConfigItem(defaultValue = "true") boolean truncate; @@ -84,7 +84,7 @@ public class SyslogConfig { String format; /** - * The log level specifying, which message levels will be logged by syslog logger + * The log level specifying what message levels will be logged by the Syslog logger */ @ConfigItem(defaultValue = "ALL") Level level; diff --git a/extensions/logging-json/runtime/src/main/java/io/quarkus/logging/json/runtime/JsonLogConfig.java b/extensions/logging-json/runtime/src/main/java/io/quarkus/logging/json/runtime/JsonLogConfig.java index f088bc614cd87..35ec19204e441 100644 --- a/extensions/logging-json/runtime/src/main/java/io/quarkus/logging/json/runtime/JsonLogConfig.java +++ b/extensions/logging-json/runtime/src/main/java/io/quarkus/logging/json/runtime/JsonLogConfig.java @@ -48,7 +48,7 @@ public static class JsonConfig { @ConfigItem(name = ConfigItem.PARENT, defaultValue = "true") boolean enable; /** - * Enable "pretty printing" of the JSON record. Note that some JSON parsers will fail to read pretty printed output. + * Enable "pretty printing" of the JSON record. Note that some JSON parsers will fail to read the pretty printed output. */ @ConfigItem boolean prettyPrint; @@ -58,7 +58,7 @@ public static class JsonConfig { @ConfigItem(defaultValue = "default") String dateFormat; /** - * The special end-of-record delimiter to be used. By default, newline is used as delimiter. + * The special end-of-record delimiter to be used. By default, newline is used. */ @ConfigItem Optional recordDelimiter; @@ -76,7 +76,7 @@ public static class JsonConfig { * Enable printing of more details in the log. *

* Printing the details can be expensive as the values are retrieved from the caller. The details include the - * source class name, source file name, source method name and source line number. + * source class name, source file name, source method name, and source line number. */ @ConfigItem boolean printDetails; @@ -87,13 +87,13 @@ public static class JsonConfig { Optional keyOverrides; /** - * Keys to be excluded from the Json output. + * Keys to be excluded from the JSON output. */ @ConfigItem Optional> excludedKeys; /** - * Additional fields to be appended in the json logs. + * Additional fields to be appended in the JSON logs. */ @ConfigItem @ConfigDocMapKey("field-name")