Can writing data to console in a docker container in linux occupy disk space?

Viewed 95

I have the following log4j.properties file in a docker container:

log4j.rootLogger=WARN,CONSOLE
log4j.logger.com.xxx.mypackage=DEBUG

# Console appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p [%c] %m%n

So, I'm logging in the console. Can this configuration consume disk space in linux? Because I have no space left in my device and the space results free after the command:

docker-compose down 
1 Answers

Yes, stdout and stderr in containers are captured as logs in docker. By default, they are stored in json without limits beside the other container filesystem changes and metadata. Those filesystem changes and logs are removed when the container is deleted. And as long as the container exists, they can be viewed with docker logs for a given container.

To limit the size of these logs, see this answer that describes the engine defaults and container specific overrides for the logs.

Related