Springboot output log to the specified directory, simple rude, springboot output mybatis log

Source: Internet
Author: User

Springboot Official Document Address https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/# Boot-features-custom-log-configuration

Spring Official Address Https://spring.io/docs

Using Springboot the default is to print the log in the console, but he does not export to the file by default, so to configure the output path, then write the output path,

We look at the official case

By default, Spring boot will only log on to the console and will not write log files. If you want to write a log file other than console output, you need to set the Logging.file or Logging.path property (for example, in application.properties).

Writes the specified log file. The name can be the exact location or relative to the current directory.

Writes spring.log to the specified directory. The name can be the exact location or relative to the current directory.

Logging: Level      :DEBUG        ./logs/core.log    INFO     

Then start the project. See if the file is generated

Log generated on local address

And, of course, he has other property configurations.

If you want to play with him, go and see his documentation and his source code comments. There will be the answer you want.

Springboot output log to the specified directory, simple rude, springboot output mybatis log

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.