Fórum

Logging User/Role Changes.

Axel Gallus, modificado 7 Anos atrás.

Logging User/Role Changes.

New Member Postagens: 10 Data de Entrada: 22/05/16 Postagens Recentes
Hi all,

one of our customers wants all changes (Control-Panel Liferay 6.2) regarding users/roles/organizations to be logged.
Can you tell me if this is possible and if so, how to activate the wanted behaviour?

PS.: I didnt find a tomcat/bin/catalina.out logfile.


Regards
Axel
deveshree zawar, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

Junior Member Postagens: 61 Data de Entrada: 09/02/16 Postagens Recentes
Hi,

You can add a logging level via Control Panel.
Go to Control Panel-> Server Administration-> Log levels-> Add category.

You can add the specific category required(User, Roles) , like "com.liferay.portal" with the level of logging selection.

Hope this helps!

Thanks,
Deveshree
Axel Gallus, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Postagens: 10 Data de Entrada: 22/05/16 Postagens Recentes
Hi,

I added a category "Users & Roles".
This category was then listed under the "Update Categories" tab.
Nothing else happened.

Can you please clarify how this helps me in logging changes which an Administrator causes
by e.g. adding or deleting users/ roles, or changing the mapping between users and roles?

I think the right approach would be to find out which class(es) log the user and roles. Then alter the log-level of this class in the "Update Categories" tab.
Moreover, where can I find the file to which those messages are logged?
And how can I delete the just added Category "Users & Roles"?

Help appreciated.

Regards
Axel
deveshree zawar, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

Junior Member Postagens: 61 Data de Entrada: 09/02/16 Postagens Recentes
Hi,

Please check your logs at : tomcat-7.0.62\logs\catalina.

You can add category of the ground level package of the specific class you want in case of Users and Roles.

For instance :com.liferay.portal.service.UserLocalService

Here you will find logs for UserLocalService.java
And, you can turn off the categories for which logging is not required.
Hope this helps!

Thanks,
Deveshree
Axel Gallus, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Postagens: 10 Data de Entrada: 22/05/16 Postagens Recentes
Hi deveshree,

yes, logging com.liferay.portal.service.UserLocalService makes sense.
However, com.liferay.portal.service.UserLocalService is not available under the Category Tab.
So, as far as I understand, it doesnt get logged at all, right?

Regards
Axel
U S Liferay, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Postagens: 14 Data de Entrada: 23/03/16 Postagens Recentes
I am not sure, emoticon .

If you want particular portlet logs, then try with hook, and write the logs.
Axel Gallus, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Postagens: 10 Data de Entrada: 22/05/16 Postagens Recentes
Hi,

I do not want to log custom-portlet messages.
I want to log Control-Panel operations regarding user and roles (add/delete) which an admin performs in the Control Panel.

Regards
Axel
deveshree zawar, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

Junior Member Postagens: 61 Data de Entrada: 09/02/16 Postagens Recentes
Hi,

Yes, it is not available under the category tab.
You ll have to add that specific category under the Add category tab and select the log level of your choice from drop down.

Thanks,
Deveshree
Axel Gallus, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Postagens: 10 Data de Entrada: 22/05/16 Postagens Recentes
Hi,

you mean, if I add "com.liferay.portal.service.UserLocalService" under the category tab via "Add category"
logging for that class will be activated?

Regards
Axel
Axel Gallus, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Postagens: 10 Data de Entrada: 22/05/16 Postagens Recentes
Hi, btw....

1.) If I add a new category, that category will not be persisted. After a server restart, the category gets lost.
2.) Even when I add "com.liferay.portal.service.UserLocalService" as a new category I cant find any log-entry in tomcat/logs/ which seems to be related to the adding/deletion of a user.

So the question remains: If you want to log "which admin changes what role/user when" , which steps need to be taken?


Regards
Axel
Austin Bryant, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

New Member Mensagem: 1 Data de Entrada: 14/11/16 Postagens Recentes
I too have the same challenges. How can I log user activations/deactivations/role assignments?

Any updates to this request? I see no replies since June.
thumbnail
Amos Fong, modificado 7 Anos atrás.

RE: Logging User/Role Changes.

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Hi Austin,

One way you could do this is with a modelListener and override the onAfterAddAssociation() and onAfterRemoveAssociation() methods.
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/creating-model-listeners

For deactivations, I created a service hook because you can't detect changes in the modelListener. You could also log role assignments with this too, you just need to find all the right methods.
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/overriding-a-portal-service-using-a-hook