RGW/Lua script does not show logs
Hello, I wrote a Lua script in order to retrieve RGW logs such as bucket name, bucket owner, etc. However, when I apply a lua script I wrote using the below command, I do not see any logs start with Lua: INFO radosgw-admin script put --infile=/usr/tmp/testPreRequest.lua --context=postrequest <my lua script> function print_bucket_log(bucket) RGWDebugLog(" Name: " .. bucket.Name) end if Request.Bucket then RGWDebugLog("bucket operation logs: ") print_bucket_log(Request.Bucket) end According to the official document regarding Lua Scripting, The RGWDebugLog() function accepts a string and prints it to the debug log with priority 20. Each log message is prefixed Lua INFO:. This function has no return value. even though I set debug_rgw = 20, I do not see any logs. However, if when I apply the below lua script with bucket.Id, I am getting Lua: ERROR like below: Lua ERROR: [string "function print_bucket_log(bucket)..."]:3: attempt to concatenate a nil value (field 'Id') <my lua script> function print_bucket_log(bucket) RGWDebugLog(" Name: " .. bucket.Name) RGWDebugLog(" Id: " .. bucket.Id) end if Request.Bucket then RGWDebugLog("bucket operation logs: ") print_bucket_log(Request.Bucket) end Any help would be very appreciated!
Hi, Can you please explain what S3 operations you perform on the RGW? I tried the 2nd script with "make bucket" and "put object", and got: 2024-04-09T13:54:00.608+0000 7f93b3987640 20 Lua INFO: bucket operation logs: 2024-04-09T13:54:00.608+0000 7f93b3987640 20 Lua INFO: Name: fish 2024-04-09T13:54:00.608+0000 7f93b3987640 20 Lua INFO: Id: 5a95e229-e949-4e6a-9c90-a2cfacb62bca.4143.1 On Tue, Apr 9, 2024 at 12:30 AM <soyoon.lee@samsung.com> wrote:
Hello, I wrote a Lua script in order to retrieve RGW logs such as bucket name, bucket owner, etc. However, when I apply a lua script I wrote using the below command, I do not see any logs start with Lua: INFO
radosgw-admin script put --infile=/usr/tmp/testPreRequest.lua --context=postrequest
<my lua script> function print_bucket_log(bucket) RGWDebugLog(" Name: " .. bucket.Name) end
if Request.Bucket then RGWDebugLog("bucket operation logs: ") print_bucket_log(Request.Bucket) end
According to the official document regarding Lua Scripting, The RGWDebugLog() function accepts a string and prints it to the debug log with priority 20. Each log message is prefixed Lua INFO:. This function has no return value. even though I set debug_rgw = 20, I do not see any logs.
However, if when I apply the below lua script with bucket.Id, I am getting Lua: ERROR like below: Lua ERROR: [string "function print_bucket_log(bucket)..."]:3: attempt to concatenate a nil value (field 'Id')
<my lua script> function print_bucket_log(bucket) RGWDebugLog(" Name: " .. bucket.Name) RGWDebugLog(" Id: " .. bucket.Id) end
if Request.Bucket then RGWDebugLog("bucket operation logs: ") print_bucket_log(Request.Bucket) end
Any help would be very appreciated! _______________________________________________ ceph-users mailing list -- ceph-users@ceph.io To unsubscribe send an email to ceph-users-leave@ceph.io
Hi Lee, RGWDebugLog logs at the debug level. Do you have the correct logging levels on your rados gateways? Should be 20. Cheers, Tom On Mon, 8 Apr 2024 at 23:31, <soyoon.lee@samsung.com> wrote:
Hello, I wrote a Lua script in order to retrieve RGW logs such as bucket name, bucket owner, etc. However, when I apply a lua script I wrote using the below command, I do not see any logs start with Lua: INFO
radosgw-admin script put --infile=/usr/tmp/testPreRequest.lua --context=postrequest
<my lua script> function print_bucket_log(bucket) RGWDebugLog(" Name: " .. bucket.Name) end
if Request.Bucket then RGWDebugLog("bucket operation logs: ") print_bucket_log(Request.Bucket) end
According to the official document regarding Lua Scripting, The RGWDebugLog() function accepts a string and prints it to the debug log with priority 20. Each log message is prefixed Lua INFO:. This function has no return value. even though I set debug_rgw = 20, I do not see any logs.
However, if when I apply the below lua script with bucket.Id, I am getting Lua: ERROR like below: Lua ERROR: [string "function print_bucket_log(bucket)..."]:3: attempt to concatenate a nil value (field 'Id')
<my lua script> function print_bucket_log(bucket) RGWDebugLog(" Name: " .. bucket.Name) RGWDebugLog(" Id: " .. bucket.Id) end
if Request.Bucket then RGWDebugLog("bucket operation logs: ") print_bucket_log(Request.Bucket) end
Any help would be very appreciated! _______________________________________________ ceph-users mailing list -- ceph-users@ceph.io To unsubscribe send an email to ceph-users-leave@ceph.io
participants (3)
-
soyoon.lee@samsung.com
-
Thomas Bennett
-
Yuval Lifshitz