core icon indicating copy to clipboard operation
core copied to clipboard

Logging: Improve Logging in dotCMS when a Page is Published from HTMLPage Portlet

Open joseorsini opened this issue 11 years ago • 2 comments

Reproduced in client and upgraded DB to 3.2.2.

Once you go to HTMLPages portlet, right click on an unpublished legacy page and click on "Publish", this is logged in the dotcms-userActivity.log file for that specific host:

[24/07/15 16:24:37:169 EDT] INFO util.ActivityLogger: class com.dotmarketing.factories.PublishFactory: demo.dotcms.com : Publishing HTMLpage action , User com.liferay.portal.model.User@eb697b99 publishing page /test/index.html

For Page assets, the behavior is the same:

[24/07/15 16:26:00:813 EDT] INFO util.ActivityLogger: class com.dotmarketing.factories.PublishFactory: demo.dotcms.com : Publishing HTMLpage action , User com.liferay.portal.model.User@eb697b99 publishing page /test/indexing

We're printing the entire User object instead of its userId https://github.com/dotCMS/core/blob/master-3.2/src/com/dotmarketing/portlets/htmlpages/action/PublishHTMLPagesAction.java#L141 so for audit purposes, it is difficult to track down who edited that specific asset.

joseorsini avatar Jul 24 '15 20:07 joseorsini

PR: https://github.com/dotCMS/core/pull/8012

joseorsini avatar Jul 24 '15 20:07 joseorsini

Fix is working, user Id is being registered on dotcms-userActivity.log file instead of entire User object.

Legacy page:

[24/08/15 11:57:54:518 CST] INFO util.ActivityLogger: class com.dotmarketing.portlets.htmlpages.action.PreviewHTMLPageAction: demo.dotcms.com : Preview HTMLpage action , User dotcms.org.1 preview page /-folder1/page1.html

Page asset:

[24/08/15 13:50:38:012 CST] INFO util.ActivityLogger: class com.dotmarketing.factories.PublishFactory: demo.dotcms.com : Publishing HTMLpage action , User dotcms.org.1 publishing page /-folder1/page1

Tested on: Ubunt 14.04 Mysql Firefox

shaydotcms avatar Aug 24 '15 19:08 shaydotcms