How to Follow Docker Logging Best Practices

Опубликовано: 18 Январь 2025
на канале: MVP Java
1,777
23

You can follow Docker logging best practices by using a symbolic link hack right in your Dockefile.

Docker logging best practice states that you should direct your logs to stdout and stderr. However, is there a way to avoid modifying your existing application to comply with that best practice? Yes there is and it’s a simple symlink hack!

In this tutorial, I'll demonstrate taking an existing Java application which will send its logs to stdout/stderr without any code modification.


00:00 Start
01:22 Code Demo Walk through explanation
02:50 Dockerfile Symlink Hack
04:35 Running Docker Logging Demo
09:31 Explain why we need Docker Logging Best Practice

Check out some other Docker tutorials here ...
   • Docker for your Java Development Envi...   (Docker for your Java Development Environment)

   • Deploy Spring Boot WAR to Tomcat in D...   (Deploy Spring Boot WAR to Tomcat in Docker Container)
   • Deploy Spring Boot WAR to Tomcat Dock...   (Deploy Spring Boot WAR to Tomcat Docker Container Linked to MongoDB)
   • How I Got Docker Certified   (How I Got Docker Certified)

======================================================

Subscribe to MVP Java ...
https://www.youtube.com/c/MVPJava?sub...

Follow me ...
Website : http://www.mvpjava.com
Facebook :   / mvpjava  
Twitter :   / mvpjava  
GitHub : https://github.com/mvpjava
DockerHub: https://hub.docker.com/?namespace=mvp...
My Company: http://www.triomni-it.com