mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-24 06:28:42 +01:00
docs: fixes grammar and spelling errors (#3413)
This commit is contained in:
@@ -4,15 +4,15 @@ title: Following Log Files on Disk
|
||||
|
||||
# Following Log Files on Disk
|
||||
|
||||
Some containers do not write logs to `sysout` or `syserr`. Many folks have asked if Dozzle can also show logs that are written to files. Unfortunately, files in containers are not accessible to other containers and so Dozzle wouldn't have a way to access these files. Dozzle can only access logs written to `sysout` or `syserr` which is the same functionality as `docker logs` command.
|
||||
Some containers do not write logs to `sysout` or `syserr`. Many folks have asked if Dozzle can also show logs that are written to files. Unfortunately, files in containers are not accessible to other containers, so Dozzle wouldn't have a way to access these files. Dozzle can only access logs written to `sysout` or `syserr`, which is the same functionality as the `docker logs` command.
|
||||
|
||||
If you are creating a service using Docker then make sure to write logs to streams. An application should not attempt to write to logfiles. Instead delegate the logging to Docker. The [twelve factor app](https://12factor.net/logs) has a great principle around logging that explains the importance of this principle.
|
||||
If you are creating a service using Docker, then make sure to write logs to streams. An application should not attempt to write to logfiles. Instead, delegate the logging to Docker. The [twelve factor app](https://12factor.net/logs) has a great principle around logging that explains the importance of this principle.
|
||||
|
||||
However, there are workarounds to be able to still access files using mounts.
|
||||
|
||||
## Mounting Local Log Files with Alpine
|
||||
|
||||
Dozzle reads any output stream. This can be used in combination with alpine to `tail` a mounted file. An example of this is as follows:
|
||||
Dozzle reads any output stream. This can be used in combination with Alpine to `tail` a mounted file. An example of this is as follows:
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -37,6 +37,6 @@ services:
|
||||
|
||||
:::
|
||||
|
||||
In the above example `/var/log/system.log` is mounted from the host and used with `tail -f` to follow the file. `tail` is smart to follow log rotations. During my testing, using alpine only uses about `300KB` of memory.
|
||||
In the above example, `/var/log/system.log` is mounted from the host and used with `tail -f` to follow the file. `tail` is smart to follow log rotations. During testing, using Alpine only uses about `300KB` of memory.
|
||||
|
||||
The second tab shows a `docker-compose` file which is useful if you want the log stream to survive server reboot.
|
||||
|
||||
Reference in New Issue
Block a user