2 ms·
That’s a total misreading of what 12 factor is about. All it means is to let someone else (other than the program itself) figure out how to get the log message
by jameshart 3y ago
That’s a total misreading of what 12 factor is about.
All it means is to let someone else (other than the program itself) figure out how to get the log messages (whatever you decide they should be) from your process (running wherever it is) to wherever you want to have those logs for inspection.
Do not hardcode into your application the assumption that they are written to a file or sent to a port.
In your application, write them to stdout.
In local dev, stdout will probably go to an interactive console. In a container running in a cloud hosted cluster it will probably go to a networked log aggregator that collects it all into an indexed time oriented data store along with other logs from other running instances.
Because you used stdout, that’s easy to do.
If you wrote them to a file whose name your application manages and changes itself to manage log rotation… either of those is hard to do.