When you application starts you should see something similar to the following:
[indent=0,subs="attributes"]
----
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: v{spring-boot-version}
2013-07-31 00:08:16.117 INFO 56603 --- [ main] o.s.b.s.app.SampleApplication : Starting SampleApplication v0.1.0 on mycomputer with PID 56603 (/apps/myapp.jar started by pwebb)
2013-07-31 00:08:16.166 INFO 56603 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6e5a8246: startup date [Wed Jul 31 00:08:16 PDT 2013]; root of context hierarchy
2014-03-04 13:09:54.912 INFO 41370 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 8080
2014-03-04 13:09:56.501 INFO 41370 --- [ main] o.s.b.s.app.SampleApplication : Started SampleApplication in 2.992 seconds (JVM running for 3.658)
----
By default `INFO` logging messages will shown, including some relevant startup details
such as the user that launched the application.
[[boot-features-customizing-spring-application]]
=== Customizing SpringApplication
If the `SpringApplication` defaults aren't to your taste you can instead create a local
instance and customize it. For example, to turn off the banner you would write:
[source,java,indent=0]
----
public static void main(String[] args) {
SpringApplication app = new SpringApplication(MySpringConfiguration.class);
app.setShowBanner(false);
app.run(args);
}
----
NOTE: The constructor arguments passed to `SpringApplication` are configuration sources
for spring beans. In most cases these will be references to `@Configuration` classes, but
they could also be references to XML configuration or to packages that should be scanned.
It is also possible to configure the `SpringApplication` using an `application.properties`
file. See ``<<boot-features-external-config>>'' for details.
For a complete list of the configuration options, see the
2014-03-05 10:57:51.253 INFO 45469 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2014-03-05 10:57:51.253 INFO 45469 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1358 ms
2014-03-05 10:57:51.698 INFO 45469 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2014-03-05 10:57:51.702 INFO 45469 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
----
The following items are output:
* Date and Time -- Millesecond precision and easily sortable.
* Log Level -- `ERROR`, `WARN`, `INFO`, `DEBUG` or `TRACE`.
* Process ID.
* A `---` separator to distinguish the start of actual log messages.
* Logger name -- This is usually the source class name (often abbreviated).
* The log message.
[[boot-features-logging-console-output]]
=== Console output
The default log configuration will echo messages to the console as they written. By
default `ERROR`, `WARN` and `INFO` level messages are logged. To also log `DEBUG` level
messages to the console you can start your application with a `--debug` flag.
[indent=0]
----
$ java -jar myapp.jar --debug
----
If your terminal supports ANSI, color output will be used to aid readability.
[[boot-features-logging-file-output]]
=== File output
By default, log files are written to `spring.log` in your `temp` directory and rotate at
10 Mb. You can easily customize the output folder by setting the `logging.path` property
(for example in your `application.properties`). It is also possible to change the filename
using a `logging.file` property.
As with console output, `ERROR`, `WARN` and `INFO` level messages are logged by default.
[[boot-features-custom-log-configuration]]
=== Custom log configuration
The various logging systems can be activated by including the appropriate libraries on
the classpath, and further customized by providing a suitable configuration file in the
root of the classpath, or in a location specified by the Spring `Environment` property
`logging.config`.
Depending on your logging system, the following files will be loaded:
|===
|Logging System |Customization
|Logback
|`logback.xml`
|Log4j
|`log4j.properties` or `log4j.xml`
|JDK (Java Util Logging)
|`logging.properties`
|===
To help with the customization some other properties are transferred from the Spring
`Environment` to System properties:
|===
|Spring Environment |System Property |Comments
|`logging.file`
|`LOG_FILE`
|Used in default log configuration if defined.
|`logging.path`
|`LOG_PATH`
|Used in default log configuration if defined.
|`PID`
|`PID`
|The current process ID is discovered if possible and not already provided.
|===
All the logging systems supported can consult System properties when parsing their
configuration files. See the default configurations in `spring-boot.jar` for examples.
WARNING: There are know classloading issues with Java Util Logging that cause problems
when running from an ``executable jar''. We recommend that you avoid it if at all
possible.
[[boot-features-developing-web-applications]]
== Developing web applications
Spring Boot is well suited for web application development. You can easily create a
self-contained HTTP server using embedded Tomcat or Jetty. Most web applications will
use the `spring-boot-starter-web` module to get up and running quickly.
If you haven't yet developed a Spring Boot web application you can follow the