Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 6.0.5 GA, 6.0.6 GA, 6.0.12 EE, 6.1.1 CE GA2, 6.1.20 EE GA2
-
Fix Version/s: 6.0.X EE, 6.1.X EE, 6.2.0 CE M5
-
Component/s: Administration, Administration > Auditing
-
Environment:RedHat / SUN JVM / Weblogic 10.3 / Oracle 11g
Liferay 5.2.3 EE
-
Branch Version/s:6.1.x, 6.0.x
-
Backported to Branch:Committed
-
Story Points:4
-
Similar Issues:
Description
If audit logging is turned on an unexpected warning with stacktrace is logged:
2011-02-18 13:24:41,052 [WARN ] [liferay/audit] com.liferay.portal.json.JSONObjectImpl - org.json.JSONException: Null key.
org.json.JSONException: Null key.
at org.json.JSONObject.put(JSONObject.java:977)
at com.liferay.portal.json.JSONObjectImpl.put(JSONObjectImpl.java:240)
at com.liferay.portal.kernel.audit.AuditMessage.toJSONObject(AuditMessage.java:255)
at com.liferay.portal.audit.service.impl.AuditEventLocalServiceImpl.addAuditEvent(AuditEventLocalServiceImpl.java:66)
The cause of the issue is located in the AuditMessage.java code on line 255 (part of the method public JSONObject toJSONObject() )
254 jsonObj.put(_CLIENT_IP, _clientIP);
255 jsonObj.put(_clientHost, _clientHost);
256 jsonObj.put(_MESSAGE, _message);
The key passed in _clientHost is incorrect. The correct key should be _CLIENT_HOST
This same code still exists in the current revision of the file: 69340, only on a different line
portal/trunk/portal-service/src/com/liferay/portal/kernel/audit/AuditMessage.java

This affects also 6.1.20 EE. Very annoying bug with a straightforward fix. Please fix it.
Currently I just commented out the use of CSVLogMessageFormatter in audit-spring.xml, which is triggering the bug on every audit event...