Publication/Subscription model in Alfresco Logs

In my previous posts related to Alfresco Debug menu we had seen how a developer can enable the logging for each widgets and how it will be displayed on the web console.

How does that logging work?

All logging is decoupled via publication/subscription model, and calling alfLog function publishes on a specific log topic (ALF_LOG_REQUEST) to which the default logging service  subscribes. Logging service first inspects calling function and attempts to determine the widget name and function name from the supplied data. Function naming has to follow particular pattern and  based on that service can identify related details.

The pattern it looks for is that the widget name and function are delimited by the last double underscore __ and it converts single underscores into forward slashes.

Let us see one example.

First see all logs in your web console. (Firefox > Developers tools>web console). If you filter out them based on one key word “ALF_PREFERENCE_GET” It will look something like this.

Logging Details1

You will be able to see Subscript and Publish related entries in the log.

Now if you click on the link on right side of each log statement you will be able to see following function which is responsible for producing that logger statement.

updateLog: function alfresco_core_PubSubLog__updateLog(type, topic, data, object) {
         var entry = {
            type: type,
            topic: topic,
            data: data,
            object: object

         // Send details to the console to enable better filter, searching and clearing.
         // This specifically avoids the logging & preference services to keep it simple & be available instantly.
         if (console && typeof console.log === "function" && AlfConstants.DEBUG)

As you could see it is following particular pattern to name the function and there is a logger statement which logs the entry.

If you see Debug menu there is one option called show “Pub/Sub” logs using that you can see the Publication/Subscription related components and its details. We will discuss more related to that option in upcoming post.

Looking for quality Alfresco Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , | Posted under Alfresco | RSS 2.0

Author Spotlight


I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.

Leave a Reply

Your email address will not be published. Required fields are marked *