Информация об изменениях

Сообщение Re: логгирование и экосистема в целом от 06.02.2023 8:53

Изменено 06.02.2023 8:53 Doom100500

Re: логгирование и экосистема в целом
Здравствуйте, IB, Вы писали:

IB>Как и куда вообще принято логгировать в Го, и где и в чем собирать метрики?


В мире миокросервисов (где сабж, в основном, и используется) есть священное писание — называется "The twelve-factor App" (https://12factor.net/).
Там, в разделе Logs (https://12factor.net/logs) навязывают рекомендуют:

A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app’s behavior.

In staging or production deploys, each process’ stream will be captured by the execution environment, collated together with all other streams from the app, and routed to one or more final destinations for viewing and long-term archival. These archival destinations are not visible to or configurable by the app, and instead are completely managed by the execution environment. Open-source log routers (such as Logplex and Fluentd) are available for this purpose.


Звучит логично, и я, в принципе, с этим согласен.
ПС: И нечего тут ржать — лучше по ссылкам почитайте.
Re: логгирование и экосистема в целом
Здравствуйте, IB, Вы писали:

IB>Как и куда вообще принято логгировать в Го, и где и в чем собирать метрики?


В мире микросервисов (где сабж, в основном, и используется) есть священное писание — называется "The twelve-factor App" (https://12factor.net/).
Там, в разделе Logs (https://12factor.net/logs) навязывают рекомендуют:

A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app’s behavior.

In staging or production deploys, each process’ stream will be captured by the execution environment, collated together with all other streams from the app, and routed to one or more final destinations for viewing and long-term archival. These archival destinations are not visible to or configurable by the app, and instead are completely managed by the execution environment. Open-source log routers (such as Logplex and Fluentd) are available for this purpose.


Звучит логично, и я, в принципе, с этим согласен.
ПС: И нечего тут ржать — лучше по ссылкам почитайте.