Here are three patterns on how to get the logs from the Docker container.
First, use -v option to mount a file location inside the container to the location inside the host file system. The -v option gives you flexibility on where to redirect files.
Second, use centralized logging server. For example, Kafka queues for further processing.
Third, you can use shared volumes from another container to pull logs into another running container. This way can save up processing resources. Imagine that every system runs a service to send logs, than it would be waste of resources to send logs from every container. Instead pull the logs into one container and use a single logging service to send logs.
This blog is a collection of minds around linux, java, javascript, etc. Looking for great opportunities.
Показаны сообщения с ярлыком logging. Показать все сообщения
Показаны сообщения с ярлыком logging. Показать все сообщения
четверг, 8 октября 2015 г.
пятница, 31 июля 2015 г.
J2EE. Logging in application
Logging is an cross-cutting concern in the application.
It is tedious to write every time
To speed up one can copy this string from one class to another.
Not very expressive way. Well, it is more code to read.
Nowadays we have annotations, we have EJB, we have CDI.
We can improve the logging code in two ways:
It is tedious to write every time
Logger log = LogManager.getLogger(getClass());
To speed up one can copy this string from one class to another.
Not very expressive way. Well, it is more code to read.
Nowadays we have annotations, we have EJB, we have CDI.
We can improve the logging code in two ways:
- implement the logging as a cross-cutting concern with a CDI interceptor
- if we need more logging it would be much simpler to inject logger
Подписаться на:
Комментарии (Atom)