

$ sudo apt-get install curl git openjdk-7-jdk maven -y Later in this article we put this application into a Docker container, but for now let’s run it directly on our Ubuntu host machine.

It uses SLF4J/Logback so we configure ‘src/main/resources/logback.xml’ to send events to its ConsoleAppender. Using our Spring Boot example fully described here, we will have it output DEBUG level logs to the console.

If you would rather explore an alternate Docker logging architecture, using a dedicated container that senses all other containers and routes their log events, see my article on Docker logspout. The Docker logging drivers capture all the output from a container’s stdout/stderr, and can send a container’s logs directly to most major logging solutions (syslog, Logstash, gelf, fluentd).Īs an added benefit, by making the logging implementation a runtime choice for the container, it provides flexibility to use a simpler implementation during development but a highly-available, scalable logging solution in production.
#Docker syslog tag file how to
But unlike a standard deployment where logging to a local file is where the developer’s responsibility typically ends, with Docker we must think about how to log to a public space outside our ephemeral container space. Building services using Spring Boot gives a development team a jump start on many production concerns, including logging.
