cancel
Showing results for 
Search instead for 
Did you mean: 

Audit content not work

mguay
Champ in-the-making
Champ in-the-making
I have an installation of Alfresco Enterprise v4.1.1.
According to the documentation http://docs.alfresco.com/4.1/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Faudit-config.h...
I should have log about login and actions performed on documents (READ, MOVE, etc.).

When I use http://localhost:8080/alfresco/service/api/audit/query/alfresco-access?verbose=true,
I not view all the audit log.

I am able to view some audit data but I see some audit log.I should see when people log authenticates to Alfresco and when move and read files ?
I'll also changes in documents, I edit the properties, I move documents, but no logging adds about these actions.
Even if I create the file C:\Alfresco\tomcat\shared\classes\alfresco\extension\audit-log4j.properties I don't have no linet about the audit in the catalina.out

Anyone can help me ?

C:\Alfresco\tomcat\shared\classes\alfresco-global.properties

# Enable audit in general
audit.enabled=true

# Enable the alfresco-access audit application
audit.alfresco-access.enabled=true

# Enable the auditing of sub-actions. Normally disabled as these values are
# not normally needed by audit configurations, but may be useful to
# developers
#audit.alfresco-access.sub-actions.enabled=true


C:\Alfresco\tomcat\shared\classes\alfresco\extension\audit-log4j.properties

log4j.logger.org.alfresco.repo.audit.AuditComponentImpl=DEBUG
log4j.logger.org.alfresco.repo.audit.inbound=DEBUG
log4j.logger.org.alfresco.repo.audit.access.AccessAuditor=DEBUG


C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\audit\alfresco-audit-access.xml

<?xml version="1.0" encoding="UTF-8"?>
<!–
  - Audit Application Definition 'alfresco-access'
  -
  - Extracts high level audit records on the creation, deletion, modification and access
  - of user visible objects.
  -
  - The following alfresco-global.properties must be set:
  -
  -   # Enable audit in general
  -   audit.enabled=true
  -
  -   # Enable the alfresco-access audit application
  -   audit.alfresco-access.enabled=true
  –>
 
<Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd">

    <DataExtractors>
       <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
       <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue"/>
    </DataExtractors>
   
    <DataGenerators>
       <DataGenerator name="currentUser" registeredName="auditModel.generator.user"/>
    </DataGenerators>

    <PathMappings>
        <PathMap source="/alfresco-access" target="/alfresco-access" />
        <PathMap source="/alfresco-api/post/ticketComponent/validateTicket/no-error" target="/alfresco-access/login"/>
        <PathMap source="/alfresco-api/post/ticketComponent/validateTicket/error" target="/alfresco-access/loginFailure"/>
        <PathMap source="/alfresco-api/post/ticketComponent/validateTicket/args/userName" target="/alfresco-access/loginUser"/>
        <PathMap source="/alfresco-api/pre/ticketComponent/invalidateTicketById/args" target="/alfresco-access/logout"/>
        <PathMap source="/alfresco-access/transaction/properties/add/cm:versionLabel" target="/alfresco-access/transaction/cm:versionLabel"/>
        <PathMap source="/alfresco-access/transaction/properties/to/cm:versionLabel" target="/alfresco-access/transaction/cm:versionLabel"/>
       
    </PathMappings>

    <Application name="alfresco-access" key="alfresco-access">
   
       <AuditPath key="login">
            <RecordValue key="user" dataExtractor="simpleValue" dataSource="/alfresco-access/loginUser" dataTrigger="/alfresco-access/login" />
        </AuditPath>

        <AuditPath key="loginFailure">
            <RecordValue key="user" dataExtractor="simpleValue" dataSource="/alfresco-access/loginUser" dataTrigger="/alfresco-access/loginFailure" /> 
        </AuditPath>

        <AuditPath key="logout">
            <GenerateValue key="user" dataGenerator="currentUser"/>
        </AuditPath>

        <AuditPath key="transaction">
            <RecordValue key="action" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/action" dataTrigger="/alfresco-access/transaction/action" /> 
            <RecordValue key="sub-actions" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/sub-actions" dataTrigger="/alfresco-access/transaction/sub-actions" /> 
            <RecordValue key="user" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/user" dataTrigger="/alfresco-access/transaction/user" /> 

            <RecordValue key="path" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/path" dataTrigger="/alfresco-access/transaction/path" />
            <RecordValue key="type" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/type" dataTrigger="/alfresco-access/transaction/type" /> 
            <RecordValue key="version" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/cm:versionLabel" dataTrigger="/alfresco-access/transaction/cm:versionLabel" /> 

            <AuditPath key="copy">
                <AuditPath key="from">
                    <RecordValue key="path" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/copy/from/path" dataTrigger="/alfresco-access/transaction/copy/from/path" />
                </AuditPath>
            </AuditPath>

            <AuditPath key="move">
                <AuditPath key="from">
                    <RecordValue key="path" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/move/from/path" dataTrigger="/alfresco-access/transaction/move/from/path" />
                </AuditPath>
            </AuditPath>
           
            <AuditPath key="properties">
                <RecordValue key="fromName" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/from/name" dataTrigger="/alfresco-access/transaction/properties/from/name" /> 
                <RecordValue key="toName" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/to/name" dataTrigger="/alfresco-access/transaction/properties/to/name" /> 
                <RecordValue key="from" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/from" dataTrigger="/alfresco-access/transaction/properties/from" /> 
                <RecordValue key="to" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/to" dataTrigger="/alfresco-access/transaction/properties/to" /> 
                <RecordValue key="add" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/add" dataTrigger="/alfresco-access/transaction/properties/add" /> 
                <RecordValue key="delete" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/delete" dataTrigger="/alfresco-access/transaction/properties/delete" /> 
            </AuditPath>
           
            <AuditPath key="aspects">
                <RecordValue key="add" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/aspects/add" dataTrigger="/alfresco-access/transaction/aspects/add" /> 
                <RecordValue key="delete" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/aspects/delete" dataTrigger="/alfresco-access/transaction/aspects/delete" /> 
            </AuditPath>
           
        </AuditPath>
       
    </Application>
       
</Audit>
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
You seem to be confusing audit with logging.  Audit is not controlled through log4j settings.

mguay
Champ in-the-making
Champ in-the-making
Hi,
I know that the logging and auditing are two separate things.
If we forget the configurations made ​​in audit-log4j.properties.
If I put this configuration in place:

C:\Alfresco\tomcat\shared\classes\alfresco-global.properties
<blockcode>
audit.enabled=true
audit.alfresco-access.enabled=true
</blockcode>


And I use this file

C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\audit\alfresco-audit-access.xml
<blockcode>
<?xml version="1.0" encoding="UTF-8"?>
 
<Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd">

    <DataExtractors>
       <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
       <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue"/>
    </DataExtractors>
   
    <DataGenerators>
       <DataGenerator name="currentUser" registeredName="auditModel.generator.user"/>
    </DataGenerators>

    <PathMappings>
        <PathMap source="/alfresco-access" target="/alfresco-access" />
        <PathMap source="/alfresco-api/post/ticketComponent/validateTicket/no-error" target="/alfresco-access/login"/>
        <PathMap source="/alfresco-api/post/ticketComponent/validateTicket/error" target="/alfresco-access/loginFailure"/>
        <PathMap source="/alfresco-api/post/ticketComponent/validateTicket/args/userName" target="/alfresco-access/loginUser"/>
        <PathMap source="/alfresco-api/pre/ticketComponent/invalidateTicketById/args" target="/alfresco-access/logout"/>
        <PathMap source="/alfresco-access/transaction/properties/add/cm:versionLabel" target="/alfresco-access/transaction/cm:versionLabel"/>
        <PathMap source="/alfresco-access/transaction/properties/to/cm:versionLabel" target="/alfresco-access/transaction/cm:versionLabel"/>
       
    </PathMappings>

    <Application name="alfresco-access" key="alfresco-access">
   
       <AuditPath key="login">
            <RecordValue key="user" dataExtractor="simpleValue" dataSource="/alfresco-access/loginUser" dataTrigger="/alfresco-access/login" />
        </AuditPath>

        <AuditPath key="loginFailure">
            <RecordValue key="user" dataExtractor="simpleValue" dataSource="/alfresco-access/loginUser" dataTrigger="/alfresco-access/loginFailure" /> 
        </AuditPath>

        <AuditPath key="logout">
            <GenerateValue key="user" dataGenerator="currentUser"/>
        </AuditPath>

        <AuditPath key="transaction">
            <RecordValue key="action" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/action" dataTrigger="/alfresco-access/transaction/action" /> 
            <RecordValue key="sub-actions" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/sub-actions" dataTrigger="/alfresco-access/transaction/sub-actions" /> 
            <RecordValue key="user" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/user" dataTrigger="/alfresco-access/transaction/user" /> 

            <RecordValue key="path" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/path" dataTrigger="/alfresco-access/transaction/path" />
            <RecordValue key="type" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/type" dataTrigger="/alfresco-access/transaction/type" /> 
            <RecordValue key="version" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/cm:versionLabel" dataTrigger="/alfresco-access/transaction/cm:versionLabel" /> 

            <AuditPath key="copy">
                <AuditPath key="from">
                    <RecordValue key="path" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/copy/from/path" dataTrigger="/alfresco-access/transaction/copy/from/path" />
                </AuditPath>
            </AuditPath>

            <AuditPath key="move">
                <AuditPath key="from">
                    <RecordValue key="path" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/move/from/path" dataTrigger="/alfresco-access/transaction/move/from/path" />
                </AuditPath>
            </AuditPath>
           
            <AuditPath key="properties">
                <RecordValue key="fromName" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/from/name" dataTrigger="/alfresco-access/transaction/properties/from/name" /> 
                <RecordValue key="toName" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/to/name" dataTrigger="/alfresco-access/transaction/properties/to/name" /> 
                <RecordValue key="from" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/from" dataTrigger="/alfresco-access/transaction/properties/from" /> 
                <RecordValue key="to" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/to" dataTrigger="/alfresco-access/transaction/properties/to" /> 
                <RecordValue key="add" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/add" dataTrigger="/alfresco-access/transaction/properties/add" /> 
                <RecordValue key="delete" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/properties/delete" dataTrigger="/alfresco-access/transaction/properties/delete" /> 
            </AuditPath>
           
            <AuditPath key="aspects">
                <RecordValue key="add" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/aspects/add" dataTrigger="/alfresco-access/transaction/aspects/add" /> 
                <RecordValue key="delete" dataExtractor="simpleValue" dataSource="/alfresco-access/transaction/aspects/delete" dataTrigger="/alfresco-access/transaction/aspects/delete" /> 
            </AuditPath>
           
        </AuditPath>
       
    </Application>
       
</Audit>
</blockcode>



I should not see entries in the audit about my attempts authentication?
I call http://localhost:8080/alfresco/service/api/audit/query/alfresco-access?verbose=true
and he have nothing about my attempts authentications

I guess I'm missing something in my setup to have in my audit entries my attempts authentication in Alfresco.
Or, maybe my files is not at the good path.

thanks you very much  !!