TAFC Logger
TAFC Logger
TAFC Logger
Introduction
This User guide describes the purpose and usage of TAFC Logger.
Currently, there are a variety of different logging subsystems across TAFC. They all have different APIs,
setup and functionality. This common library framework resolves the problem of multiple APIs.
Introduced in TAFC R12, the TAFC logger is designed to be both component based and generic
framework for logging. Having a single library allows logging to be controlled across entire TAFC. The
library provides all necessary wrappers for C and jBC.
Assumptions
The executor of this test plan should be familiar with jBASE / TAFC.
1 jCF jCF
2 InitChecks initchecks
3 jAGENT Agent
By default TAFC logger is enabled, and can be enabled or disabled by setting variable “LOGGING” to
“FILE” or “OFF”. This logging variable can be set for all the TAFC Components using [logger] section and
may be overridden by logger variables for a specific TAFC component such as agent or jBC.
Logger configuration
Logger can be configured with a section in its tafc.ini file. [Select tafc.ini depending on TAFC_CONTEXT].
Logger can also be configured for both common logging framework and component specific logging
framework.
Common Logging framework section name: - logger, written in tafc.ini file as “[logger]”. Any variables
under this library will be considered for the entire logging framework unless it is overridden in its
respective component specific framework.
LOGGING
When this variable is set, the logger is on and has default enough information to run. This variable
defines a message storage type.
LOGGING=FILE.
LOG_DIR
This variable sets a directory where log files are written.
LOG_DIR=directory
LOGTOSTDERR
This variable defines whether log messages go to stderr instead of a log file.
LOGTOSTDERR=value
ALSOLOGTOSTDERR
This variable defines whether log messages go to stderr additionally to a log file.
ALSOLOGTOSTDERR=value
STDERRTHRESHOLD
This 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=value
Allowed values (not case insensitive): "INFO" (or 0), "WARNING" (or 1), "ERROR" (or 2), "FATAL" (or 3).
LOG_PREFIX
This variable defined where log messages are depended with a prefix.
LOG_PREFIX=value
“L” – A single character, representing the log level (for example, 'I' for INFO)
Example:
LOGBUFSECS
This variable sets the maximum number of seconds which logs may be buffered for.
MINLOGLEVEL_FILE=value
Allowed values (case sensitive): "INFO" (or 0), "WARNING" (or 1), "ERROR" (or 2), "FATAL" (or 3).
MINLOGLEVEL_EVENTVIEWER
This variable is used if users want log messages to be sent into Windows Event Log (viewed with Event
viewer).
LOG_TO_SINGLE_FILE
This variable is used to specify a single file per severity. The supported severity are INFO,
WARNING,ERROR and FATAL. The filename format is <Component>.<System Nmae>.log.<Severity>. It
can be enabled in [LOGGER] section of the tafc.ini file by setting the variable as follows:
LOG_TO_SINGLE_FILE=true
LOG_TO_SINGLE_FILE=date
LOGFILE_COMPONENT_NAME
This variable is used to specify a single component name for all the log files. It can be done by setting
the variable in the [LOGGER] section of the tafc.ini file as follows:
LOGFILE_COMPONENT_NAME=<Component Name>
Example:
LOGFILE_COMPONENT_NAME=T24
ENABLE_WRITE_TO_STDERR
This variable enables writing to stderr. If it is not set in [LOGGER] section of tafc.ini file, then it is
recommended to it will turn off writing to stderr.
Sample Logging Screenshots
Disable Logging for one specific component and enable for remaining TAFC components.
[initchecks]
LOGGING=OFF
/// Below section is optional
[logger]
LOGGING=FILE
Enable Logging for one specific component and disable for remaining TAFC components.
[initchecks]
LOGGING=FILE
[logger]
LOGGING=OFF
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
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 variable in tafc.ini. We can however configure the JBC logger
variable using “[jBC]” section.
TAFC_LOG_INFO
TAFC_LOG_WARNING
TAFC_LOG_ERROR
Sample.b
INCLUDE JBC.h
You can define jBC section for Logger variables in tafc.ini file as shown below-
Note: The minimum log level for jBC is ERROR superceding that of the generic log level. Therefore errors
of level ERROR and above would be logged for any jBC code.
There could be individual sections within jBC for each product such as CUSTOMER , ACCOUNT OR
FUNDSTRANSFER. A sample is shown below
[CUSTOMER]
MINLOGLEVEL_FILE=INFO
[ACCOUNT]
MINLOGLEVEL_FILE=ERROR
[FUND-TRANSFER]
MINLOGLEVEL_FILE=WARNING
Detailed information of the event from the Event Viewer
Window
Log Name: Application
Source: libTAFClogger
Event ID: 1
Level: Error
Keywords: Classic
User: ASIA\dhanyaj
Computer: maad11012639.asia.temenosgroup.com
Description:
ERROR - E0120 15:13:19.386320 5624 TAFC_InitCheck.cpp:653] [TAFC] Stop database on TIC Error
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Level>2</Level>
<Task>1</Task>
<Keywords>0x80000000000000</Keywords>
<EventRecordID>4110</EventRecordID>
<Channel>Application</Channel>
<Computer>maad11012639.asia.temenosgroup.com</Computer>
</System>
<EventData>
<Data>E0120 15:13:19.386320 5624 TAFC_InitCheck.cpp:653] [TAFC] Stop database on TIC Error
</Data>
</EventData>
</Event>
Screenshot of log files generated
Contents of INFO File:
MINLOGLEVEL_EVENTVIEWER=INFO
This is not recommended as users end up receiving thousands of log messages in Windows event log and
it will fill up.
MINLOGLEVEL_EVENTVIEWER=WARNING
MINLOGLEVEL_EVENTVIEWER=ERROR
Note: The Windows Event Logs generated here are based on the values of tafc.ini and Logger program
provided here. Other components may be logged on changing the parameter values of Logger function
and jBC components.
Appendix A:
Sample Log Details:
STDERRTHRESHOLD FATAL
MINLOGLEVEL_EVENTVIEWER INFO
MINLOGLEVEL_FILE INFO
ALSOLOGTO_EVENTVIEWER TRUE
ALSOLOGTO_EVE TRUE -
NTVIEWER