/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* http://forgerock.org/license/CDDLv1.0.html
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at http://forgerock.org/license/CDDLv1.0.html
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
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:
http://openidm.forgerock.org/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.