help request: how to configure file-log plugin? #8292
Replies: 3 comments 1 reply
-
I realized that it is due to permissions. I'm using this docker-compose as example: https://github.com/apache/apisix-docker/blob/master/example/docker-compose.yml Something wrong? 2022/11/09 21:48:20 [error] 51#51: *2135341 [lua] file-logger.lua:117: write_file_data(): failed to open file: /file.log, error info: /file.log: Permission denied while logging request, client: 172.19.0.1, server: _, request: "GET /test/lala HTTP/1.1", upstream: "https://172.67.180.245:443/test/lala", host: "127.0.0.1:9080" |
Beta Was this translation helpful? Give feedback.
-
It's obvious the apisix workers cannot write the / dir. If I remember correctly, the base dir for file-logger is /usr/local/apisix/conf? |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm also having trouble activating this plugin. Here is my route configuration: {
"uri": "/novocep/*",
"name": "teste-cep",
"methods": [
"GET"
],
"plugins": {
"file-logger": {
"disable": false,
"path": "logs/file.log"
},
"key-auth": {
"disable": false,
"header": "Authorization",
"hide_credentials": true
}
},
"service_id": "432940486001427136",
"labels": {
"API_VERSION": "v1"
},
"status": 1
} Here is the error I get in the error.log file:
Does anyone have an idea what it could be? :( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to enable file-log plugin on my route but no file was created. What i missed? Any aditional config in other place/entity?
If I use a relative path, as doc example (logs/file.log), what is the base directory?
Also, is there any way to log apisix requests to upstream services? Does file-log plugin records it?
APISIX version: 3.0.0
Beta Was this translation helpful? Give feedback.
All reactions