User Guide -TAFC -R12 Logger

14
TAFC R12 Logging User Guide Information in this document is subject to change without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV. Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

description

user guide

Transcript of User Guide -TAFC -R12 Logger

Page 1: User Guide -TAFC -R12 Logger

TAFC R12

Logging

User Guide

Page 1Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Information in this document is subject to change without notice.No part of this document may be reproduced or transmitted in any form or by any means,

electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2006 TEMENOS Holdings NV. All rights reserved.

Page 2: User Guide -TAFC -R12 Logger

Document revisionsDate Author Changes Made20/07/2011 Satya Ravipati Initial revision20/10/2011 Gerard Thomas Reviewed.

LoggerPrint changed to Logger

Page 2

Page 3: User Guide -TAFC -R12 Logger

ContentsIntroduction.................................................................................................................................................4TAFC logger................................................................................................................................................6

Logger configuration...............................................................................................................................6Sample Logging Screenshots..................................................................................................................8Sample scenario.......................................................................................................................................8

Page 3

Page 4: User Guide -TAFC -R12 Logger

IntroductionThis User guide is intended for the TAFC logger.

Currently there are a variety of different logging subsystems across TAF-C. They all have different API, setup and functionality. This common library framework resolves the problem of multiple API.

Introduced in TAFC R12, the TAFC logger is designed to be both component based and generic framework for logging. Having one single library allows controlling logging for entire TAF-C and provides all necessary wrappers for C and jBC.

By default the TAFC logger is enabled. Logger may be enabled or disabled globally by setting the variable “LOGGING” to “FILE” or to “OFF” respectively in the tafc.ini configuration file. Logging can be configured for specific components such as jBC or Agent. The specific configuration overrides the generic configuration.

Page 4

Page 5: User Guide -TAFC -R12 Logger

AssumptionsThe user should be familiar with jBASE / TAFC.

Page 5

Page 6: User Guide -TAFC -R12 Logger

TAFC Logger

TAFC logger can be used in some or all of the components of TAFC release package. TAFC logger uses the file tafc.ini of its CONTEXT to describe the Logging Framework functionality with a separate section called “[logger]” and with some other variables. At present Logging Framework is provided for the components listed below . Each component has its own TAFC component name defined (ie. the name to use in the tafc.ini file), and this component name is used to specify component level logging functionality.

TAFC Component Component Logger Section Name1 jCF jCF 2 InitChecks initchecks3 jAgent agent45

Note - Not a Component but a Library but is treated as one from a configuration viewpoint

Default location for Tafc logger to generate log files is $TAFC_HOME/log/$TAFC_CONTEXT File names follow the naming format ;<TafcComponentName.>.<hostname>.<user name>.log.<severity level>.<date>.<time>.<pid>

Logger configuration

Logger can be configured with a section in the tafc.ini file. [Select tafc.ini depending on TAFC_CONTEXT]. Logger can also be configured for both common logging framework and also component specific logging framework.

Common Logging framework section name is loggerand is written in tafc.ini file as “[logger]”. Any variables under this library will be considered for the entire logging framework except if it is overridden in a component specific framework.

List of logging framework variables that can be used to configure TAFC Logger are given below

TAFC Logger Variables1. LOGGING

When this variable is set, the logger is on and has default enough information to run. This variable defines a message storage type.For example, a configuration for the file message storage:LOGGING=FILE. Defaults value is FILE if not defined.

2. LOG_DIRThis variable sets a directory where log files are written.LOG_DIR=directoryFor example, LOG_DIR=$TAFC_HOME/log/$TAFC_CONTEXTDefaults value is $TAFC_HOME/log/$TAFC_CONTEXT if not defined.

3. LOGTOSTDERR

Page 6

Page 7: User Guide -TAFC -R12 Logger

This variable defines whether log messages go to stderr instead of a log file.LOGTOSTDERR=valuePossible values (not case sensitive):• 1, yes, true – flag is on• 0, no, false – flag is off [default]

4. ALSOLOGTOSTDERRThis variable defines whether log messages go to stderr additionally to a log file.ALSOLOGTOSTDERR=valuePossible values (not case sensitive):• 1, yes, true – flag is on• 0, no, false – flag is off [default]

5. STDERRTHRESHOLDThis variable defines whether log messages go to stderr depending of the severity. All messages having at a level great or equal this value will be also sent to stderr.STDERRTHRESHOLD=valueAllowed values (not case insensitive): "INFO" (or 0), "WARNING" (or 1), "ERROR" (or 2), "FATAL" (or 3).Defaults value is ERROR if not defined

6. LOG_PREFIXThis variable defined where log messages are depended with a prefix.LOG_PREFIX=valuePossible values (not case sensitive):• 1, yes, true – flag is on [default]• 0, no, false – flag is offLog line prefix formatLog lines have this form: Lmmdd hh:mm:ss.uuuuuu pid file:line] msg...where the fields are defined as follows:• “L” – A single character, representing the log level (for example, 'I' for INFO)• m – The month (zero padded, for example May is '05'• dd – The day (zero padded)• hh:mm:ss.uuuuuu – Time in hours, minutes and fractional seconds• pid – The space-padded processed ID• file – The file name• line – The line number• msg – The user-supplied messageExample: I1103 11:57:31.739339 24395 main.cpp:2341] Command line: ./some_prog I1103 11:57:31.739403 24395 main.cpp:2342] Process id 24395

7. LOGBUFSECSThis variable sets the maximum number of seconds which logs may be buffered for.LOGBUFSECS=value_in_seconds [default = 30]

8. MINLOGLEVEL_FILEThis variable defines log suppression level: messages logged at a lower level than this are suppressed.MINLOGLEVEL_FILE=valueAllowed values (not case insensitive): "INFO" (or 0), "WARNING" (or 1), "ERROR" (or 2), "FATAL" (or 3).Defaults value is INFO if not defined.

Page 7

Page 8: User Guide -TAFC -R12 Logger

Sample Logging ScreenshotsScreenshot for some sample log files on Windows/UNIX

It not mandatory that link files like “initchecks.INFO”, “initchecks.WARNING” and “initchecks.ERROR” are always available, They are not available in any version of windows below WINDOWS VISTA.

Screenshot of the actual file

Page 8

Page 9: User Guide -TAFC -R12 Logger

Sample scenariosBy default logging is enabled for all the components that are using new TAFC logging framework.

1. Disable Logging for one specific component and enable for remaining TAFC components.[initchecks]LOGGING=OFF/// Below section is optional[logger]LOGGING=FILE

2. Enable Logging for one specific component and disable for remaining TAFC components.[initchecks]LOGGING=FILE[logger]LOGGING=OFF

3. Set minimum log level for initchecks to INFO and minimum log level for rest of the components to WARNING. (we need not set LOGGING as it is enabled by default)[initchecks]MINLOGLEVEL_FILE=INFO[logger]MINLOGLEVEL_FILE=WARNING

Page 9

Page 10: User Guide -TAFC -R12 Logger

jBC API for TAFC logger

jBC API is a wrapper for TAFC logger that enables the JBASE BASIC code to use TAFC logger library. It works similar to TAFC logger library and gives customer a function to generate logging at different levels.

TAFC logger can use the same set of logger variables in tafc.ini. We can configure the jBC logger behaviour using the “[jBC]” section.

Logging happens at different levels ranging from 0 to 3 namely: TAFC_LOG_INFO TAFC_LOG_WARNING TAFC_LOG_ERROR TAFC_LOG_FATAL (This will make the Application to terminate)

INFO is the lowest and FATAL is the highest. These values are defined in the header JBC.h.

jBC API Logger FunctionLogger(VAR Category, VAR Severity, VAR Message)

Sample ProgramSample.bINCLUDE JBC.h

Logger("CUSTOMER", TAFC_LOG_INFO, "Test Program JBC-CUSTOMER")Logger("ACCOUNT", TAFC_LOG_WARNING, "Test Program for JBC-ACCOUNT")Logger("FUND-TRANSFER", TAFC_LOG_ERROR, "Test Program for JBC-FUND-TRANSFER")

Commands used to compile and Generate exceutables:-

Page 10

Page 11: User Guide -TAFC -R12 Logger

We can define jBC section for Logger variables in tafc.ini file as below:-

Note that the minimum log level for jBC is ERROR superceding that of the generic log level WARNING. Therefore errors of level ERROR and above would be logged for any jBC code.

Page 11

Page 12: User Guide -TAFC -R12 Logger

This program will produce a list of files. The list and the respective file contents are shown below

List of LOG File Generated:-

INFO Log File looks like:-

WARNING Log File looks like :-

ERROR Log File looks like:-

Page 12