README
Logging in Scripts Sample
-------------------------
Copyright (c) 2012 ForgeRock AS
This work is licensed under a Creative Commons Attribution-
NonCommercial-NoDerivs 3.0 Unported License. See
http://creativecommons.org/licenses/by-nc-nd/3.0/
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/install-guide/index.html#more-sample8
To try the sample, follow these steps.
1. Copy the sample configuration and data.
$ cd /path/to/openidm
$ cp -r samples/sample8/conf samples/sample8/script .
2. Start OpenIDM.
$ ./startup.sh
3. Run reconciliation.
$ curl -u openidm-admin:openidm-admin -X POST "http://localhost:8080/openidm/sync?_action=recon&mapping=systemXmlfileAccounts_managedUser"
4. Observe messages from your scripts that are logged to the OpenIDM
(Felix) console:
2012-05-25 01:37:41:276 WARN [LoggerPropertyFactory$1$2] Case no Source: the source object contains: = null
2012-05-25 01:37:41:277 WARN [LoggerPropertyFactory$1$2] Case emptySource: the source object contains: = {__UID__=1, email=[mail1@example.com], name=DDOE1, lastname=Doe1, firstname=Darth1, description=Created By XML1, _id=1}
2012-05-25 01:37:41:278 WARN [LoggerPropertyFactory$1$2] Case sourceDescription: the source object contains: = Created By XML1
2012-05-25 01:37:41:279 WARN [LoggerPropertyFactory$1$2] Case onCreate: the source object contains: = {__UID__=1, email=[mail1@example.com], name=DDOE1, lastname=Doe1, firstname=Darth1, description=Created By XML1, _id=1}
2012-05-25 01:37:41:341 WARN [LoggerPropertyFactory$1$2] Case result: the source object contains: = {UNQUALIFIED={count=0, ids=[]}, NOTVALID={count=0, ids=[]}, reconId=561d1deb-db21-4642-98e6-bd33e3421ad2, TARGET_IGNORED={count=0, ids=[]}, ABSENT={count=1, ids=[1]}, AMBIGUOUS={count=0, ids=[]}, endTime=5/25/12 1:37 PM, FOUND={count=0, ids=[]}, startTime=5/25/12 1:37 PM, allIds=247, SOURCE_IGNORED={count=0, ids=[]}, duration=121, UNASSIGNED={count=0, ids=[]}, entries=1, reconName=system/xmlfile/account, CONFIRMED={count=0, ids=[]}, MISSING={count=0, ids=[]}, SOURCE_MISSING={count=0, ids=[]}}
Read the short scripts in samples/sample8/script/ to see examples of how
to use the logger object.