Commit a0d7d521 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Add ROLLING_FILE_NAME_PATTERN for File Appender"

See gh-18151
parent 4a3810a0
...@@ -1777,7 +1777,7 @@ To help with the customization, some other properties are transferred from the S ...@@ -1777,7 +1777,7 @@ To help with the customization, some other properties are transferred from the S
| `logging.pattern.rolling-file-name` | `logging.pattern.rolling-file-name`
| `ROLLING_FILE_NAME_PATTERN` | `ROLLING_FILE_NAME_PATTERN`
| Pattern to use when roll-over log files (default `$\{LOG_FILE}.%d\{yyyy-MM-dd}.%i.gz`). | Pattern for rolled-over log file names (default `$\{LOG_FILE}.%d\{yyyy-MM-dd}.%i.gz`).
(Only supported with the default Logback setup.) (Only supported with the default Logback setup.)
| `PID` | `PID`
......
...@@ -97,7 +97,8 @@ public class LoggingSystemProperties { ...@@ -97,7 +97,8 @@ public class LoggingSystemProperties {
public static final String LOG_DATEFORMAT_PATTERN = "LOG_DATEFORMAT_PATTERN"; public static final String LOG_DATEFORMAT_PATTERN = "LOG_DATEFORMAT_PATTERN";
/** /**
* The name of the System property that contains the rolled-over log file pattern. * The name of the System property that contains the rolled-over log file name
* pattern.
*/ */
public static final String ROLLING_FILE_NAME_PATTERN = "ROLLING_FILE_NAME_PATTERN"; public static final String ROLLING_FILE_NAME_PATTERN = "ROLLING_FILE_NAME_PATTERN";
......
...@@ -47,7 +47,6 @@ import org.springframework.util.unit.DataSize; ...@@ -47,7 +47,6 @@ import org.springframework.util.unit.DataSize;
* @author Madhura Bhave * @author Madhura Bhave
* @author Vedran Pavic * @author Vedran Pavic
* @author Robert Thornton * @author Robert Thornton
* @author Eddú Meléndez
*/ */
class DefaultLogbackConfiguration { class DefaultLogbackConfiguration {
......
...@@ -61,7 +61,6 @@ import org.springframework.util.StringUtils; ...@@ -61,7 +61,6 @@ import org.springframework.util.StringUtils;
* @author Dave Syer * @author Dave Syer
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Ben Hale * @author Ben Hale
* @author Eddú Meléndez
* @since 1.0.0 * @since 1.0.0
*/ */
public class LogbackLoggingSystem extends Slf4JLoggingSystem { public class LogbackLoggingSystem extends Slf4JLoggingSystem {
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
{ {
"name": "logging.pattern.rolling-file-name", "name": "logging.pattern.rolling-file-name",
"type": "java.lang.String", "type": "java.lang.String",
"description": "Pattern for roll-over log files. Supported only with the default Logback setup.", "description": "Pattern for rolled-over log file names. Supported only with the default Logback setup.",
"sourceType": "org.springframework.boot.context.logging.LoggingApplicationListener", "sourceType": "org.springframework.boot.context.logging.LoggingApplicationListener",
"defaultValue": "${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz" "defaultValue": "${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz"
}, },
......
...@@ -84,7 +84,7 @@ class LoggingSystemPropertiesTests { ...@@ -84,7 +84,7 @@ class LoggingSystemPropertiesTests {
} }
@Test @Test
void rollingFileIsSet() { void rollingFileNameIsSet() {
new LoggingSystemProperties( new LoggingSystemProperties(
new MockEnvironment().withProperty("logging.pattern.rolling-file-name", "rolling file pattern")) new MockEnvironment().withProperty("logging.pattern.rolling-file-name", "rolling file pattern"))
.apply(null); .apply(null);
......
...@@ -69,7 +69,7 @@ class LogbackConfigurationTests { ...@@ -69,7 +69,7 @@ class LogbackConfigurationTests {
} }
@Test @Test
void defaultFileNamePattern() throws JoranException { void defaultRollingFileNamePattern() throws JoranException {
JoranConfigurator configurator = new JoranConfigurator(); JoranConfigurator configurator = new JoranConfigurator();
LoggerContext context = new LoggerContext(); LoggerContext context = new LoggerContext();
configurator.setContext(context); configurator.setContext(context);
...@@ -82,7 +82,7 @@ class LogbackConfigurationTests { ...@@ -82,7 +82,7 @@ class LogbackConfigurationTests {
} }
@Test @Test
void customFileNamePattern() throws JoranException { void customRollingFileNamePattern() throws JoranException {
JoranConfigurator configurator = new JoranConfigurator(); JoranConfigurator configurator = new JoranConfigurator();
LoggerContext context = new LoggerContext(); LoggerContext context = new LoggerContext();
configurator.setContext(context); configurator.setContext(context);
......
...@@ -539,7 +539,7 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { ...@@ -539,7 +539,7 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
} }
@Test @Test
void testRollingFileProperty() { void testRollingFileNameProperty() {
MockEnvironment environment = new MockEnvironment(); MockEnvironment environment = new MockEnvironment();
String rollingFile = "my.log.%d{yyyyMMdd}.%i.gz"; String rollingFile = "my.log.%d{yyyyMMdd}.%i.gz";
environment.setProperty("logging.pattern.rolling-file-name", rollingFile); environment.setProperty("logging.pattern.rolling-file-name", rollingFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment