/*
 * Copyright 2014-2017 ForgeRock AS. All Rights Reserved
 *
 * Use of this code requires a commercial software license with ForgeRock AS.
 * or with one of its affiliates. All use shall be exclusively subject
 * to such license between the licensee and ForgeRock AS.
 */

Logging in Scripts Sample
-------------------------

This sample demonstrates logging capabilities available to OpenIDM scripts,
providing you an alternative method for debugging your scripts.

For documentation pertaining to this example see:
https://forgerock.org/openidm/doc/bootstrap/samples-guide/#more-sample-8

To try the sample, follow these steps.

    1. Start OpenIDM with the configuration for sample 8.

    $ cd /path/to/openidm
    $ ./startup.sh -p samples/sample8

    2. Run reconciliation.

    $ curl -k -H "Content-type: application/json" -u "openidm-admin:openidm-admin" -X POST "https://localhost:8443/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"

    3. Observe messages from your scripts that are logged to the OpenIDM
       (Felix) console:

    2014-04-18 16:05:53:030 WARN Case no Source: the source object contains: = null  [02aa75cd-d216-4b48-897e-1ac85136476e]
    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]
    2014-04-18 16:05:53:032 WARN Case sourceDescription: the source object contains: = Created By XML1  [863784e9-ce98-446a-931b-569e81e22a70]
    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]
    2014-04-18 16:05:53:048 WARN Case no Source: the source object contains: = null  [02aa75cd-d216-4b48-897e-1ac85136476e]
    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]
    2014-04-18 16:05:53:050 WARN Case sourceDescription: the source object contains: = Created By XML1  [863784e9-ce98-446a-931b-569e81e22a70]
    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]
    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]

    Read the short scripts inline within samples/sample8/conf/sync.json to see examples of how to use the logger object.
