I want to mask user data so i need to create a service config where i can create more than one regex and the service should match the regex and mask the data in log file.
How we can achieve in AEM ?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
in case of AEM 6 you will have logback as logging implementation. I am not familiar with logback at all, but I think, that there are ways to post-process log statements, so masking user data should be possible. [1] can give you a starting point.
kind regards,
Jörg
[1] https://sling.apache.org/documentation/development/logging.html#logback-integration
Create an OSGi bundle and deploy. Are you new to writing OSGi bundles? If so -- read:
https://helpx.adobe.com/experience-manager/using/first-osgi.html
Because the OSGi bundle is implemented as Java - you can use Java to perform a Mask. Here is a Stackoverflow of how to mask in Java:
http://stackoverflow.com/questions/12148281/mask-string-with-characters
If you need to get/read AEM user data - then use Jackrabbit API in the service.
Using Jackrabbit UserManager APIs to create AEM Users and Groups
Developing AEM OSGi bundles that use Jackrabbit UserManager APIs
Views
Replies
Total Likes
Hi,
in case of AEM 6 you will have logback as logging implementation. I am not familiar with logback at all, but I think, that there are ways to post-process log statements, so masking user data should be possible. [1] can give you a starting point.
kind regards,
Jörg
[1] https://sling.apache.org/documentation/development/logging.html#logback-integration
I need to override the OOTB logger service in which i have to add my regex configuration where author can configure log file name. pattern matching for logging and other OOTB configuration. How can i override the default one so that my service should get picked.
Views
Replies
Total Likes
"I need to override the OOTB logger service"
See these AEM doc topics for information:
https://docs.adobe.com/docs/en/cq/5-6-1/deploying/configure_logging.html
http://docs.adobe.com/docs/en/cq/5-6-1/deploying/monitoring_and_maintaining.html#Create a Custom Log File
See:
Name: org.apache.sling.commons.log.names
Type: String[] (String + Multi)
Value: specify the OSGi services for which the Logger is to log messages; for example, all of the following:
You can write a log service - that is where you need to inject Java app logic to meet your mask requirements.
Views
Replies
Total Likes
Views
Like
Replies