7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel/**
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * Copyright (c) 2014 ForgeRock AS. All rights reserved.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * The contents of this file are subject to the terms
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * of the Common Development and Distribution License
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * (the License). You may not use this file except in
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * compliance with the License.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * You can obtain a copy of the License at
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * http://forgerock.org/license/CDDLv1.0.html
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * See the License for the specific language governing
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * permission and limitations under the License.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * When distributing Covered Code, include this CDDL
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * Header Notice in each file and include the License file
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * at http://forgerock.org/license/CDDLv1.0.html
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * If applicable, add the following below the CDDL Header,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * with the fields enclosed by brackets [] replaced by
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * your own identifying information:
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * "Portions Copyrighted [year] [name of copyright owner]"
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel */
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark CraigLogging in Scripts Sample
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark Craig-------------------------
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark CraigThis sample demonstrates logging capabilities available to OpenIDM scripts,
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark Craigproviding you an alternative method for debugging your scripts.
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark CraigFor documentation pertaining to this example see:
17ac9740889daa3a239caefc6fb8615c60b5a6d1Lana Frosthttp://openidm.forgerock.org/doc/bootstrap/samples-guide/#more-sample-8
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark CraigTo try the sample, follow these steps.
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
4b4c3a2028eea921136be5b4717c69c074b4982eLana 1. Start OpenIDM with the configuration for sample 8.
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark Craig $ cd /path/to/openidm
4b4c3a2028eea921136be5b4717c69c074b4982eLana $ ./startup.sh -p samples/sample8
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
4b4c3a2028eea921136be5b4717c69c074b4982eLana 2. Run reconciliation.
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel $ curl -k -H "Content-type: application/json" -u "openidm-admin:openidm-admin" -X POST "https://localhost:8443/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"
c092ef02fabf1fa2d2e5ccb6f8da6d5ba7573775Matthias Tristl
4b4c3a2028eea921136be5b4717c69c074b4982eLana 3. Observe messages from your scripts that are logged to the OpenIDM
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark Craig (Felix) console:
29d50b69fe5a5fbf7a96984f3d303567853fa543Mark Craig
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:030 WARN Case no Source: the source object contains: = null [02aa75cd-d216-4b48-897e-1ac85136476e]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:032 WARN Case emptySource: the source object contains: = {password=TestPassw0rd#, _id=scarter, email=scarter@example.com, firstname=Steven, description=Created By XML1, name=scarter@example.com, mobileTelephoneNumber=1234567, roles=openidm-admin,openidm-authorized, lastname=Carter} [5389b810-1b0b-409a-8f4e-3a4358d7ef96]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:032 WARN Case sourceDescription: the source object contains: = Created By XML1 [863784e9-ce98-446a-931b-569e81e22a70]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:034 WARN Case onCreate: the source object contains: = {password=TestPassw0rd#, _id=scarter, email=scarter@example.com, firstname=Steven, description=Created By XML1, name=scarter@example.com, mobileTelephoneNumber=1234567, roles=openidm-admin,openidm-authorized, lastname=Carter} [1ddf5116-eacd-4632-9bb8-b1dbcc80796b]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:048 WARN Case no Source: the source object contains: = null [02aa75cd-d216-4b48-897e-1ac85136476e]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:049 WARN Case emptySource: the source object contains: = {password=TestPassw0rd#, _id=bjensen, email=bjensen@example.com, firstname=Barbara, description=Created By XML1, name=bjensen@example.com, mobileTelephoneNumber=1234567, roles=openidm-authorized, lastname=Jensen} [5389b810-1b0b-409a-8f4e-3a4358d7ef96]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:050 WARN Case sourceDescription: the source object contains: = Created By XML1 [863784e9-ce98-446a-931b-569e81e22a70]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:050 WARN Case onCreate: the source object contains: = {password=TestPassw0rd#, _id=bjensen, email=bjensen@example.com, firstname=Barbara, description=Created By XML1, name=bjensen@example.com, mobileTelephoneNumber=1234567, roles=openidm-authorized, lastname=Jensen} [1ddf5116-eacd-4632-9bb8-b1dbcc80796b]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 2014-04-18 16:05:53:274 WARN Case result: the source object contains: = {SOURCE_IGNORED={count=0, ids=[]}, UNQUALIFIED={count=0, ids=[]}, NOTVALID={count=0, ids=[]}, processed=2, UNASSIGNED={count=0, ids=[]}, TARGET_IGNORED={count=0, ids=[]}, CONFIRMED={count=0, ids=[]}, AMBIGUOUS={count=0, ids=[]}, ABSENT={count=2, ids=[bjensen, scarter]}, MISSING={count=0, ids=[]}, SOURCE_MISSING={count=0, ids=[]}, FOUND={count=0, ids=[]}} [59c9ca37-66bd-48d4-907a-564590b1e41f]
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel Read the short scripts inline within samples/sample8/conf/sync.json to see examples of how to use the logger object.