help.axcms.netAxinom Logo
Save Save Chapter Send Feedback

Logging Actions contains support for logging actions. What is "Action"? It is something that happens inside the system. comes with a list of pre-defined actions. Besides that you can define your own actions in your code (Templates, Extras, etc.). Some of the pre-defined actions are already in use (like AxCMSLoginAction) - used when a cms-user logs in), the others must be used (called) from your code (like AxRegisterAction - it is supposed to be called from the code of your registration form).

Configuring Action Logging

Add a new section "AxActionLog" to your web.config:

type="Axinom.AECMS.Logging.AxActionLogSectionHandler, AxCMS.BL"

In the section itself list all your logger with mode="on" or mode="off":

<action class="Axinom.AECMS.Publish.PublishPageActivity" mode="on" />
<action class="Axinom.AECMS.Logging.AxCMSLoginAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxCheckOutAction" mode="off" />

If a logger is not specified in the config, its mode is assumed to be "off". 

You will find the whole list of the available logger below.

Using Actions in Code

To use an existing Action in your code, instance your logger-class, pass the necessary parameter and call its Log()-method. For example, to log an Action of registering a new member in live system, using code like this:

AxAction action = new AxRegisterAction(member);


List of the Available Actions

Management System

<action class="Axinom.AECMS.Logging.AxCMSLoginAction" mode="on" />
<action class="Axinom.AECMS.AddStructureElementActivity" mode="on" />
<action class="Axinom.AECMS.CheckinActivity" mode="on" />
<action class="Axinom.AECMS.Logging.CheckOutAction" mode="on" />
<action class="Axinom.AECMS.ClassifyActivity" mode="on" />
<action class="Axinom.AECMS.CloneActivity" mode="on" />
<action class="Axinom.AECMS.BulkOperations.CreatePageSnapshotFileActivity" mode="on" />
<action class="Axinom.AECMS.DeleteActivity" mode="on" />
<action class="Axinom.AECMS.FillPropertiesActivity" mode="on" />
<action class="Axinom.AECMS.ImportUserActivity" mode="on" />
<action class="Axinom.AECMS.MoveDownActivity" mode="on" />
<action class="Axinom.AECMS.MoveUpActivity" mode="on" />
<action class="Axinom.AECMS.RecoverActivity" mode="on" />
<action class="Axinom.AECMS.RestoreSnapshotActivity" mode="on" />
<action class="Axinom.AECMS.BulkOperations.ObjectCheckinActivity" mode="on" />
<action class="Axinom.AECMS.BulkOperations.ObjectDeleteActivity" mode="on" />
<action class="Axinom.AECMS.Publish.PublishDocumentActivity" mode="on" />
<action class="Axinom.AECMS.Publish.PublishMailTemplateActivity" mode="on" />
<action class="Axinom.AECMS.Publish.PublishNewsletterActivity" mode="on" />
<action class="Axinom.AECMS.Publish.PublishPageActivity" mode="on" />
<action class="Axinom.AECMS.Publish.RequestPublishingActivity" mode="on" />
<action class="Axinom.AECMS.Publish.RevokeApprovalPageActivity" mode="on" />

Live System

<action class="Axinom.AECMS.Logging.AxPageViewAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxDocumentViewAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxLoginAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxRegisterAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxSearchAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxTeaserAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxTrackedLinkAction" mode="on" />
<action class="Axinom.AECMS.Logging.AxSubscribeAction" mode="on" /><action class="Axinom.AECMS.Logging.AxUnSubscribeAction" mode="on" />

Contact Module

<action class="ContactModule.BL.ContactFormAction" mode="on" />

In Management System the AxCMSLoginAction logs all the logins into CMS itself. All the other actions track particular activities in CMS.

In Live System following Actions are defined:

AxPageViewAction - it is called every time a CMS-Page is requested. The call is built-in into CMS-HttpHandler, so you don't have to call it yourself. If you let it ON, it will generate a significant amount of records in the database. The collected information is essentially the same, which can be gained from the IIS-log files. A major difference is, that CMS-Logger knows about page relation to navigation and allows to aggregate the information later in a meaningful way.

AxDocumentViewAction - like AxPageViewAction, but applies to AxDocument instead of AxPage. Is called from the AuthenticationModule. If you don't use AuthenticationModule, you will not get this actions, unless you create your own HttpModule and let it call this logger. Like with AxPageViewAction, beware of the data volume generated by this logger.

AxLoginAction - is supposed to be called by your login page, after a successful login. Pass logged in user as a parameter.

AxRegisterAction - is supposed to be called by your registration page, when the user is successfully registered or activated - your choice. Pass the registered user as a parameter.

AxSearchAction - is supposed to be called by your search-page. Pass the search-term and number of results as parameters.

AxTeaserAction - is supposed to be called by the Lists/Search-controls for every item shown to the user. It helps monitor the most popular resources of your web-site. But beware of the data volume which could be potentially generated by this logger.

AxTrackedLinkAction - is called in redirect page of which is used when user selects to track clicks on a link.

AxSubscribeAction/AxUnSubscribeAction - is supposed to be called in register formulars.

ContactFormAction - Contact Module comes with its own Action. It is called every time a contact form is submited. This logger saved all the fields of the contact form as XML in the database. 

This diagram shows the basic relations between classes of actions.

Defining Custom Actions

To define your own action:

  • Create a new class. Follow the naming convention <project><actionName>Action. E.g. MyRegistrationAction.
  • Inherit your class from one of the classes (e.g. AxAction, AxUserAction, AxElementAction). The choice of the base class is based on the amount if information available for your new action.
  • Configure your action (see Configuring Actions). As class specify the full type name with its namespace.
  • Call your Action in code (see Using Actions).
  • If you want Page-related properties to be correctly set (CurrentPage, ReferrerPage, etc.) and you cannot inherit from AxPageAction, override SetActionData()-method like this:
    public class AxRegisterAction : AxUserAction
            public AxRegisterAction(AxUser user) : base(user) { }
            public override void SetActionData()


All actions are logged into the database in the table AxActionLog:

CREATE TABLE [dbo].[AxActionLog]
    [AxId] [bigint] IDENTITY(1,1) NOT NULL,
    [UserId] [int] NULL,
    [CreateDate] [datetime] NOT NULL DEFAULT GETDATE(),
    [Action] [nvarchar](300) NOT NULL,    
    [ElementId] [bigint] NULL,
    [ElementType] [smallint] NULL,
    [CurrentPage] [int] NULL,
    [CurrentNavigation] [int] NULL,
    [ReferrerPage] [int] NULL,
    [ReferrerNavigation] [int] NULL,
    [Amount] [bigint] NULL,
    [XmlData] [ntext] NULL,
    [Comment] [ntext] NULL,
    [IP] [nvarchar] (16) NULL

UserId is a reference to AxUsers.

Action is a full type name of the logger-class.

ElementId and ElementType is a standard representation of IClassifiable - is any element an action relates to. 

CurrentPage is a reference to AxPage - is a page, where the action takes place.

CurrentNavigation is a reference to AxCategory - is a navigation node where CurrentPage is assigned to.

ReferrerPage is a reference to AxPage - is a page, from which the CurrentPage was called.

ReferrerNavigation is a reference to AxCategory - is a navigation node where ReferrerPage is assigned to.

Amount - is a free integer field (e.g. for AxSearchAction it is a number of search results)

XmlData - is a free XML-text field (e.g. for ContactFormAction it is the content of the form as XML)

Comment - is a free text field (e.g. for AxSearchAction it is the search term)

IP - is the IP of the current users computer.