Redirect Caddy logs to file to avoid large log volume
This commit is contained in:
Родитель
645c7d8615
Коммит
f4ce72011b
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 187 KiB |
|
@ -362,6 +362,12 @@ The Caddy webserver deployed in the solution uses [Let's Encrypt](https://letsen
|
|||
This service is free. If desired, you may use a different
|
||||
[certificate authority and webserver configuration](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-container-group-ssl).
|
||||
|
||||
To reduce the amount of logs stored in the Log Analytics workspace, the Caddy webserver output is redirected to a file.
|
||||
To inspect the webserver logs, navigate to the Bridge container group in Azure Portal (whose name starts with `iotc-container-groups-`), under `Containers` select the `caddy-ssl-server` container. Click the `Connect` tab and select `/bin/sh`. The logs
|
||||
will be in the `/tmp/caddy.log` file. To see the last 10 lines of logs, use the command `tail -n 10 /tmp/caddy.log`, as in the image below:
|
||||
|
||||
![Webserver logs](Docs/Assets/caddy-logs.png "webserver logs")
|
||||
|
||||
## Custom adapters
|
||||
One of the possible ways to extend the functionality of this Bridge is through a custom adapter deployed as a sidecar container.
|
||||
With this type of adapter, which can be written in the language and runtime of your choice, you can for instance transform
|
||||
|
|
|
@ -168,14 +168,11 @@ echo " - name: \"${bridgeContainerName}\"
|
|||
cpu: 0.8
|
||||
- name: caddy-ssl-server
|
||||
properties:
|
||||
image: caddy:latest
|
||||
image: caddy@sha256:d0b43ebda8fd47409cec98d5f3c3b4c60bfc6bca35338313c002dc64c2283055
|
||||
command:
|
||||
- \"caddy\"
|
||||
- \"run\"
|
||||
- \"--config\"
|
||||
- \"/mnt/caddyfile\"
|
||||
- \"--adapter\"
|
||||
- \"caddyfile\"
|
||||
- \"/bin/sh\"
|
||||
- \"-c\"
|
||||
- \"caddy run --config /mnt/caddyfile --adapter caddyfile 2>> /tmp/caddy.log\"
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 443
|
||||
|
|
|
@ -321,14 +321,11 @@
|
|||
{
|
||||
"name": "caddy-ssl-server",
|
||||
"properties": {
|
||||
"image": "caddy:latest",
|
||||
"image": "caddy@sha256:d0b43ebda8fd47409cec98d5f3c3b4c60bfc6bca35338313c002dc64c2283055",
|
||||
"command": [
|
||||
"caddy",
|
||||
"reverse-proxy",
|
||||
"--from",
|
||||
"[concat(parameters('bridge-name'), '.', resourceGroup().location, '.azurecontainer.io')]",
|
||||
"--to",
|
||||
"localhost:3000"
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"[concat('caddy reverse-proxy --from ', parameters('bridge-name'), '.', resourceGroup().location, '.azurecontainer.io', ' --to localhost:3000 2>> /tmp/caddy.log')]"
|
||||
],
|
||||
"ports": [
|
||||
{
|
||||
|
|
|
@ -273,14 +273,11 @@
|
|||
{
|
||||
"name": "caddy-ssl-server",
|
||||
"properties": {
|
||||
"image": "caddy:latest",
|
||||
"image": "caddy@sha256:d0b43ebda8fd47409cec98d5f3c3b4c60bfc6bca35338313c002dc64c2283055",
|
||||
"command": [
|
||||
"caddy",
|
||||
"reverse-proxy",
|
||||
"--from",
|
||||
"[concat(parameters('bridge-name'), '.', resourceGroup().location, '.azurecontainer.io')]",
|
||||
"--to",
|
||||
"localhost:5001"
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"[concat('caddy reverse-proxy --from ', parameters('bridge-name'), '.', resourceGroup().location, '.azurecontainer.io', ' --to localhost:5001 2>> /tmp/caddy.log')]"
|
||||
],
|
||||
"ports": [
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче