1. Core Properties
Key | Default Value | Description |
---|---|---|
debug | false | Enable debug logs. |
info.* | Arbitrary properties to add to the info endpoint. | |
logging.charset.console | Charset to use for console output. | |
logging.charset.file | Charset to use for file output. | |
logging.config | Location of the logging configuration file. For instance, `classpath:logback.xml` for Logback. | |
logging.exception-conversion-word | %wEx | Conversion word used when logging exceptions. |
logging.file.name | Log file name (for instance, `myapp.log`). Names can be an exact location or relative to the current directory. | |
logging.file.path | Location of the log file. For instance, `/var/log`. | |
logging.group.* | Log groups to quickly change multiple loggers at the same time. For instance, `logging.group.db=org.hibernate,org.springframework.jdbc`. | |
logging.level.* | Log levels severity mapping. For instance, `logging.level.org.springframework=DEBUG`. | |
logging.logback.rollingpolicy.clean-history-on-start | false | Whether to clean the archive log files on startup. |
logging.logback.rollingpolicy.file-name-pattern | ${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz | Pattern for rolled-over log file names. |
logging.logback.rollingpolicy.max-file-size | 10MB | Maximum log file size. |
logging.logback.rollingpolicy.max-history | 7.0 | Maximum number of days archive log files are kept. |
logging.logback.rollingpolicy.total-size-cap | 0B | Total size of log backups to be kept. |
logging.pattern.console | %clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} | Appender pattern for output to the console. Supported only with the default Logback setup. |
logging.pattern.dateformat | yyyy-MM-dd HH:mm:ss.SSS | Appender pattern for log date format. Supported only with the default Logback setup. |
logging.pattern.file | %d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} | Appender pattern for output to a file. Supported only with the default Logback setup. |
logging.pattern.level | %5p | Appender pattern for log level. Supported only with the default Logback setup. |
logging.register-shutdown-hook | false | Register a shutdown hook for the logging system when it is initialized. |
spring.aop.auto | true | Add @EnableAspectJAutoProxy. |
spring.aop.proxy-target-class | true | Whether subclass-based (CGLIB) proxies are to be created (true), as opposed to standard Java interface-based proxies (false). |
spring.application.admin.enabled | false | Whether to enable admin features for the application. |
spring.application.admin.jmx-name | org.springframework.boot:type=Admin,name=SpringApplication | JMX name of the application admin MBean. |
spring.application.name | Application name. | |
spring.autoconfigure.exclude | Auto-configuration classes to exclude. | |
spring.banner.charset | UTF-8 | Banner file encoding. |
spring.banner.image.bitdepth | 4.0 | Bit depth to use for ANSI colors. Supported values are 4 (16 color) or 8 (256 color). |
spring.banner.image.height | Height of the banner image in chars (default based on image height). | |
spring.banner.image.invert | false | Whether images should be inverted for dark terminal themes. |
spring.banner.image.location | classpath:banner.gif | Banner image file location (jpg or png can also be used). |
spring.banner.image.margin | 2.0 | Left hand image margin in chars. |
spring.banner.image.pixelmode | TEXT | Pixel mode to use when rendering the image. |
spring.banner.image.width | 76.0 | Width of the banner image in chars. |
spring.banner.location | classpath:banner.txt | Banner text resource location. |
spring.beaninfo.ignore | true | Whether to skip search of BeanInfo classes. |
spring.codec.log-request-details | false | Whether to log form data at DEBUG level, and headers at TRACE level. |
spring.codec.max-in-memory-size | Limit on the number of bytes that can be buffered whenever the input stream needs to be aggregated. This applies only to the auto-configured WebFlux server and WebClient instances. By default this is not set, in which case individual codec defaults apply. Most codecs are limited to 256K by default. | |
spring.config.activate.on-cloud-platform | Required cloud platform for the document to be included. | |
spring.config.activate.on-profile | Profile expressions that should match for the document to be included. | |
spring.config.additional-location | Config file locations used in addition to the defaults. | |
spring.config.import | Import additional config data. | |
spring.config.location | Config file locations that replace the defaults. | |
spring.config.name | application | Config file name. |
spring.info.build.encoding | UTF-8 | File encoding. |
spring.info.build.location | classpath:META-INF/build-info.properties | Location of the generated build-info.properties file. |
spring.info.git.encoding | UTF-8 | File encoding. |
spring.info.git.location | classpath:git.properties | Location of the generated git.properties file. |
spring.jmx.default-domain | JMX domain name. | |
spring.jmx.enabled | false | Expose management beans to the JMX domain. |
spring.jmx.server | mbeanServer | MBeanServer bean name. |
spring.jmx.unique-names | false | Whether unique runtime object names should be ensured. |
spring.lifecycle.timeout-per-shutdown-phase | 30s | Timeout for the shutdown of any phase (group of SmartLifecycle beans with the same ‘phase’ value). |
spring.main.allow-bean-definition-overriding | false | Whether bean definition overriding, by registering a definition with the same name as an existing definition, is allowed. |
spring.main.banner-mode | console | Mode used to display the banner when the application runs. |
spring.main.cloud-platform | Override the Cloud Platform auto-detection. | |
spring.main.lazy-initialization | false | Whether initialization should be performed lazily. |
spring.main.log-startup-info | true | Whether to log information about the application when it starts. |
spring.main.register-shutdown-hook | true | Whether the application should have a shutdown hook registered. |
spring.main.sources | Sources (class names, package names, or XML resource locations) to include in the ApplicationContext. | |
spring.main.web-application-type | Flag to explicitly request a specific type of web application. If not set, auto-detected based on the classpath. | |
spring.mandatory-file-encoding | Expected character encoding the application must use. | |
spring.messages.always-use-message-format | false | Whether to always apply the MessageFormat rules, parsing even messages without arguments. |
spring.messages.basename | messages | Comma-separated list of basenames (essentially a fully-qualified classpath location), each following the ResourceBundle convention with relaxed support for slash based locations. If it doesn’t contain a package qualifier (such as “org.mypackage”), it will be resolved from the classpath root. |
spring.messages.cache-duration | Loaded resource bundle files cache duration. When not set, bundles are cached forever. If a duration suffix is not specified, seconds will be used. | |
spring.messages.encoding | UTF-8 | Message bundles encoding. |
spring.messages.fallback-to-system-locale | true | Whether to fall back to the system Locale if no files for a specific Locale have been found. if this is turned off, the only fallback will be the default file (e.g. “messages.properties” for basename “messages”). |
spring.messages.use-code-as-default-message | false | Whether to use the message code as the default message instead of throwing a “NoSuchMessageException”. Recommended during development only. |
spring.output.ansi.enabled | detect | Configures the ANSI output. |
spring.pid.fail-on-write-error | Fails if ApplicationPidFileWriter is used but it cannot write the PID file. | |
spring.pid.file | Location of the PID file to write (if ApplicationPidFileWriter is used). | |
spring.profiles.active | Comma-separated list of active profiles. Can be overridden by a command line switch. | |
spring.profiles.include | Unconditionally activate the specified comma-separated list of profiles (or list of profiles if using YAML). | |
spring.quartz.auto-startup | true | Whether to automatically start the scheduler after initialization. |
spring.quartz.jdbc.comment-prefix | [#, --] | Prefixes for single-line comments in SQL initialization scripts. |
spring.quartz.jdbc.initialize-schema | embedded | Database schema initialization mode. |
spring.quartz.jdbc.schema | classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql | Path to the SQL file to use to initialize the database schema. |
spring.quartz.job-store-type | memory | Quartz job store type. |
spring.quartz.overwrite-existing-jobs | false | Whether configured jobs should overwrite existing job definitions. |
spring.quartz.properties.* | Additional Quartz Scheduler properties. | |
spring.quartz.scheduler-name | quartzScheduler | Name of the scheduler. |
spring.quartz.startup-delay | 0s | Delay after which the scheduler is started once initialization completes. Setting this property makes sense if no jobs should be run before the entire application has started up. |
spring.quartz.wait-for-jobs-to-complete-on-shutdown | false | Whether to wait for running jobs to complete on shutdown. |
spring.reactor.debug-agent.enabled | true | Whether the Reactor Debug Agent should be enabled when reactor-tools is present. |
spring.task.execution.pool.allow-core-thread-timeout | true | Whether core threads are allowed to time out. This enables dynamic growing and shrinking of the pool. |
spring.task.execution.pool.core-size | 8.0 | Core number of threads. |
spring.task.execution.pool.keep-alive | 60s | Time limit for which threads may remain idle before being terminated. |
spring.task.execution.pool.max-size | Maximum allowed number of threads. If tasks are filling up the queue, the pool can expand up to that size to accommodate the load. Ignored if the queue is unbounded. | |
spring.task.execution.pool.queue-capacity | Queue capacity. An unbounded capacity does not increase the pool and therefore ignores the “max-size” property. | |
spring.task.execution.shutdown.await-termination | false | Whether the executor should wait for scheduled tasks to complete on shutdown. |
spring.task.execution.shutdown.await-termination-period | Maximum time the executor should wait for remaining tasks to complete. | |
spring.task.execution.thread-name-prefix | task- | Prefix to use for the names of newly created threads. |
spring.task.scheduling.pool.size | 1.0 | Maximum allowed number of threads. |
spring.task.scheduling.shutdown.await-termination | false | Whether the executor should wait for scheduled tasks to complete on shutdown. |
spring.task.scheduling.shutdown.await-termination-period | Maximum time the executor should wait for remaining tasks to complete. | |
spring.task.scheduling.thread-name-prefix | scheduling- | Prefix to use for the names of newly created threads. |
trace | false | Enable trace logs. |
application.properties or application.yml
Save HTTP Request Access Log as file.
server.tomcat.accesslog.pattern=common
server.tomcat.accesslog.enabled=true
server.tomcat.basedir=.
server:
tomcat:
basedir: .
accesslog:
pattern: common
enabled: true
- Directory logs will be automatically created.
- access_log.2020-xx-xx.log
0:0:0:0:0:0:0:1 - - [24/Nov/2020:21:52:12 +0900] "GET /greeting HTTP/1.1" 200 45
0:0:0:0:0:0:0:1 - - [24/Nov/2020:21:52:20 +0900] "GET /greeting HTTP/1.1" 200 45
https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#spring.jta.enabled