How to increase oned.log per line print length?

HI, Quick question I hope.

How can we increase the oned.log file per line printing to not truncated the output?

Example:


Fri Jan 17 13:09:42 2025 [Z0][ReM][D]: Req:8912 UID:0 IP:10.225.100.63 one.vm.attach invoked , 497, "disk=/var/lib/libvir..."

Fri Jan 17 13:10:21 2025 [Z0][ReM][D]: Req:1760 UID:0 one.zone.raftstatus result SUCCESS, "<RAFT><SERVER_ID>-1<..."

On different service fireedge there is thje below configurable for this. On oned.config I don’t seen anything similar. As a long shot I tried adding “truncate_max_length:” to oned.config, but it failed to start (as likely expected on unknown configurable.)


oneadmin@:/var/log/one$ less /etc/one/fireedge-server.conf 


# Log debug level: https://github.com/winstonjs/winston#using-logging-levels
#   0 = ERROR, 1 = WARNING, 2 = INFO, 5 = DEBUG
#
debug_level: 5

# Maximum length of log messages (chars)
# Messages exceeding this limit will be truncated
# -1 => No limit
truncate_max_length: 1000 


Hi,

Check the parameters of the LOG_CALL_FORMAT variable in the /etc/one/oned.conf.

Usually, you’d need to uncomment the line and alter the last (%l) argument.

Best Regards,
Anton Todorov

1 Like

Hi Anton,

Thanks for the quick replay. I had missed that section of the oned.conf file.

I made this change and restarted the service, but given the text “invoke” on the format string; I wonder if this will also affect the response log printing? Is there another setting for responses?

Before:

#  LOG_CALL_FORMAT: Format string to log XML-RPC calls. Interpreted strings:
#     %i -- request id
#     %m -- method name
#     %u -- user id
#     %U -- user name
#     %l[number] -- param list and number of characters (optional) to print
#                   each parameter, default is 20. Example: %l300
#     %p -- user password
#     %g -- group id
#     %G -- group name
#     %a -- auth token
#     %A -- client IP address (only IPv4 supported)
#     %P -- client TCP port
#     %% -- %
#*******************************************************************************

#MAX_CONN           = 15
#MAX_CONN_BACKLOG   = 15
#KEEPALIVE_TIMEOUT  = 15
#KEEPALIVE_MAX_CONN = 30
#TIMEOUT            = 15
#RPC_LOG            = NO
#MESSAGE_SIZE       = 1073741824
#LOG_CALL_FORMAT    = "Req:%i UID:%u IP:%A %m invoked %l20"

Changed only this 1 line:

LOG_CALL_FORMAT    = "Req:%i UID:%u IP:%A %m invoked %l300"

systemctl restart opennebula.service

still “result” log is truncated:


Tue Jan 21 14:31:33 2025 [Z0][ReM][D]: Req:4288 UID:0 IP:127.0.0.1 one.vmpool.infoextended invoked , -2, -1, -1, -1
Tue Jan 21 14:31:33 2025 [Z0][ReM][D]: Req:4288 UID:0 one.vmpool.infoextended result SUCCESS, "<VM_POOL><VM><ID>508...

Also I’m currently using version 6.10.0 and attempted this config change on two different setups. 1 setup built with minione ansible playbooks and a 2nd build with OneDeploy playbooks. Which I assume covers this documentation warning?

"This functionality is only available when compiled with xmlrpc-c libraries >= 1.32. Currently only the packages distributed by OpenNebula are linked with this library."

Digging in the code, only the log of the request takes into account the %l parameter. The response is working with the hard-coded value of 20.

If you need the request/response to debug/develop an application using the OpenNebula API I found it useful to set mitmproxy and observe the full interaction from there.

Best Regards,
Anton Todorov

I ran into this same issue. And ran across this thread in my search for a solution. Eventually I created a ticket at OpenNebula (we have Enterprise support). This was there response:

Hello,
the logs shown come from the OpenNebula XMLRPC API. The LOG_CALL_FORMAT parameter only affects the API received requests (one/src/rm/Request.cc at d87b3869d7a18e6f8943c0a12f033a2046dcc72e · OpenNebula/one · GitHub), but the API replies are automatically truncated to 20 by default (one/src/rm/Request.cc at d87b3869d7a18e6f8943c0a12f033a2046dcc72e · OpenNebula/one · GitHub). Currently it’s not possible to configure the length of the logs for the OpenNebula XMLRPC API replies. We will internally evaluate adding this possibility.

So seems like an oversight that they will likely fix.

1 Like