Bug #6663
closedMetacat does not record http request "User-Agent" into the event log
0%
Description
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.
Updated by Jing Tao almost 10 years ago
- Assignee changed from ben leinfelder to Jing Tao
Updated by Jing Tao almost 10 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.
Updated by Jing Tao almost 10 years ago
- Status changed from New to Resolved
The source and test code was committed to both trunk and 2.4 branch.
Updated by Jing Tao almost 10 years ago
- Target version changed from 2.5.0 to 2.4.3