Foros de discusión

Enable auditing in LR 7?

thumbnail
Steve Weiss, modificado hace 6 años.

Enable auditing in LR 7?

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
We have a set of listeners that provided custom auditing in LR 6.2. In order to get auditing working we had to install the audit hook and audit portlet. Is there a version of this for LR 7 or is auditing enabled in some other way? I've converted our listeners for LR 7 and deployed them as a module. The listeners work, the appropriate method is called when I add a document but there doesn't seem to be anything stored in the database and nothing in the audit reports in the control panel. Am I missing something?

Here is some code:
    protected void auditOnCreateOrRemove(EventType eventType, DLFileEntry dlFileEntry)
        throws ModelListenerException {

        _log.info("auditOnCreateOrRemove:ENTER");
        try {
            AuditMessage auditMessage =
                AuditMessageBuilder.buildAuditMessage(eventType, DLFileEntry.class.getName(),
                                dlFileEntry.getFileEntryId(), null);

            JSONObject additionalInfo = auditMessage.getAdditionalInfo();

            additionalInfo.put("title", dlFileEntry.getTitle());
            additionalInfo.put("description", dlFileEntry.getDescription());
            additionalInfo.put("mimeType", dlFileEntry.getMimeType());
            additionalInfo.put("fileEntryTypeId", dlFileEntry.getFileEntryTypeId());
            additionalInfo.put("extraSettings", dlFileEntry.getExtraSettings());
            auditMessage.setAdditionalInfo(additionalInfo);
            _auditRouter.route(auditMessage);

        } catch (Exception e) {
            throw new ModelListenerException(e);
        }
        _log.info("auditOnCreateOrRemove:EXIT");

    }
thumbnail
David H Nebinger, modificado hace 6 años.

RE: Enable auditing in LR 7?

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
Auditing is baked into Liferay DXP (it is not available for Liferay 7 CE).

There is a settings configuration panel for auditing, you might want to check there and make sure you've enabled it.






Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Steve Weiss, modificado hace 6 años.

RE: Enable auditing in LR 7?

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
In the control panel, I see "Audit" in the "Components" section. It's marked active. But although my listener is being called there is nothing shown when I go to Configuration > Audit. Just a message that says there are no events. There are no records in the database table AUDIT_AUDITEVENT either.
thumbnail
David H Nebinger, modificado hace 6 años.

RE: Enable auditing in LR 7?

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
How about if you go to Control Panel -> Configuration -> System Settings -> Foundation -> Audit, you should see that it is enabled in there.











Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Steve Weiss, modificado hace 6 años.

RE: Enable auditing in LR 7?

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
Yes, it is enabled there too. But still no events shown in Configuration>Audit.
thumbnail
David H Nebinger, modificado hace 6 años.

RE: Enable auditing in LR 7?

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
I have a clean DXP FP 2X (28 I think) and auditing is working just fine...









Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Steve Weiss, modificado hace 6 años.

RE: Enable auditing in LR 7?

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
Ok, I have DXP but I know it's not the latest. I'll set up a clean install of a newer version and see what happens. Thanks.
Raghu teja, modificado hace 6 años.

RE: Enable auditing in LR 7?

Junior Member Mensajes: 61 Fecha de incorporación: 10/03/11 Mensajes recientes
Hi,

Did you get any solutions for this. Still I see there is no events in the configuration-> audit.

Also we see in system settings of foundation , Audit is enabled.

Not Sure how we can audit events.
thumbnail
Steve Weiss, modificado hace 6 años.

RE: Enable auditing in LR 7?

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
I installed a later version (sp4) and audit worked right out of the box. I don't know if the problem was with the earlier version or not.
Raghu teja, modificado hace 6 años.

RE: Enable auditing in LR 7?

Junior Member Mensajes: 61 Fecha de incorporación: 10/03/11 Mensajes recientes
I got the Solution we Should enable the "Persistent Message Audit Message Processor ".

We can find at ControlPanel - > Configuration -> System Settings .

Search with Audit , you will find the "Persistent Message Audit Message Processor " , click on it and check the "Enabled" checkbox and click on the save button.

We are using LiferayDXP
David Weitzel, modificado hace 6 años.

RE: Enable auditing in LR 7?

Junior Member Mensajes: 65 Fecha de incorporación: 7/10/15 Mensajes recientes
Hi David
Is there a knowledge base article about auditing on DXP? The two settings you mention are activated but I only see login events. We need to be auditing content editors work (JournalArticle create/edit and FileEntry add/modify events at a minimum).
we are on DE24 (sp4+ ) but may be later builds have added audit events to their configurations.
I haven't seen any documentation about what is in the system settings configuration files and the search isn't particularly good at finding values to set.
thumbnail
David H Nebinger, modificado hace 6 años.

RE: Enable auditing in LR 7?

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
David Weitzel:
Is there a knowledge base article about auditing on DXP? The two settings you mention are activated but I only see login events. We need to be auditing content editors work (JournalArticle create/edit and FileEntry add/modify events at a minimum).


Not really.

I would send you to the following:

https://web.liferay.com/community/wiki/-/wiki/Main/Audit+Service
https://web.liferay.com/community/wiki/-/wiki/Main/Adding+Auditing+Functionality+to+Portlets

They are not updated for DXP specifically, but all of the development concepts still apply. Understanding the wiki pages will help explain how Liferay approaches auditing.

For the types of events you're looking for, you would implement a ModelListener on the JournalArticle entity. Then in the onAfterXxx() methods, you would build an audit message and submit to the AuditRouterUtil. They'll then appear in your audit log.

You might ask "Why doesn't Liferay audit everything by default?" The answer is that every organization tends to need their own level of auditing of different things, and why audit everything by default when most orgs wouldn't need that kind of overhead? Instead, they just provide you the tools to support auditing but leave the actual capturing of audit records to the implementors.