Metacat does not record http request "User-Agent" into the event log
All entries in the 'access_log' table on KNB have user_agent equal to NULL, i.e. the query
"select count(*) from access_log where user_agent IS NOT NULL;" returns 0. In MetacatHandler.readFromMetacat,
for example, userAgent is passed to EventLog but nulls are being recorded.
#2 Updated by Jing Tao almost 6 years ago
It turned out the constructor of EventLogData class didn't have the field for user-agent.
I found the user-agent can be very long. For example, it is "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" for using Chrome browser to get an object.
In our access_log table, the length of the column of user_agent is 512. So I will add a check to the user agent before we write it to database, if its length is less than or equals 512, we will write all of them to database; otherwise, we only write first 512 characters.